Skip to content

Commit

Permalink
Merge pull request silverstripe#2174 from dhensby/pulls/3/redirector-…
Browse files Browse the repository at this point in the history
…link

FIX Make RedirectorPage::Link compatible with SiteTree::Link
  • Loading branch information
robbieaverill committed May 23, 2018
2 parents dfdaac4 + b6dbae8 commit 12826b2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/model/RedirectorPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ public function ContentSource() {
* If the redirectorpage has been appropriately configured, then it will return the redirection
* destination, to prevent unnecessary 30x redirections. However, if it's misconfigured, then
* it will return a link to itself, which will then display an error message.
* @param null $action
* @return null|string
*/
public function Link() {
if($link = $this->redirectionLink()) return $link;
else return $this->regularLink();
public function Link($action = null) {
if ($link = $this->redirectionLink()) {
return $link;
}
return $this->regularLink($action);
}

/**
Expand Down

0 comments on commit 12826b2

Please sign in to comment.