Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
FIX, adding better task message support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Feb 27, 2017
1 parent 690da81 commit bc348bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [misdirection](https://packagist.org/packages/nglasl/silverstripe-misdirection)

_The current release is **2.2.18**_
_The current release is **2.2.19**_

> A module for SilverStripe which will allow both simple and regular expression link redirections based on customisable mappings, either hooking into a page not found or replacing the default automated URL handling.
Expand Down
6 changes: 3 additions & 3 deletions code/tasks/MisdirectionHistoricalLinkMappingTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ public function run($request) {
$this->live = true;
}
else {
echo '<div>Running in <strong>test</strong> mode... to actually create link mappings, append <strong>?live=1</strong> to the URL...</div><br>';
DB::alteration_message('<div>Running in <strong>test</strong> mode... to actually create link mappings, append <strong>?live=1</strong> to the URL...</div><br>');
}
$this->setupStructure();
$records = $this->getPublishedVersionRecords();
$this->processRecords($records);
$this->checkAndCreateMappings();
echo '<strong>Complete!</strong>';
DB::alteration_message('<strong>Complete!</strong>');
}

/**
Expand Down Expand Up @@ -268,7 +268,7 @@ protected function checkAndCreateMappings() {
"FullURL = '{$URL}'"
);
if($query->count('ID') == 0) {
echo "<div>{$siteTreeID} - {$URL}</div><br>";
DB::alteration_message("<div>{$siteTreeID} - {$URL}</div><br>");
if($this->live) {
singleton('MisdirectionService')->createPageMapping($URL, $siteTreeID);
}
Expand Down

0 comments on commit bc348bc

Please sign in to comment.