diff --git a/code/Model/SiteTree.php b/code/Model/SiteTree.php index 2c19f44513..c994fa654b 100755 --- a/code/Model/SiteTree.php +++ b/code/Model/SiteTree.php @@ -688,15 +688,17 @@ public function RelativeLink($action = null) $base = $this->URLSegment; } - $this->extend('updateRelativeLink', $base, $action); - // Legacy support: If $action === true, retain URLSegment for homepages, // but don't append any action if ($action === true) { $action = null; } - return Controller::join_links($base, '/', $action); + $link = Controller::join_links($base, '/', $action); + + $this->extend('updateRelativeLink', $link, $base, $action); + + return $link; } /** diff --git a/code/Model/SiteTreeExtension.php b/code/Model/SiteTreeExtension.php index 8813c61dfe..dd1cfab272 100644 --- a/code/Model/SiteTreeExtension.php +++ b/code/Model/SiteTreeExtension.php @@ -75,13 +75,15 @@ public function canPublish($member) * before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()} * on the $base and $action * - * @param string &$base The URL of this page relative to siteroot, not including + * @param string &$link The URL of this page relative to siteroot including * the action - * @param string|boolean &$action The action or subpage called on this page. + * @param string $base The URL of this page relative to siteroot, not including + * the action + * @param string|boolean $action The action or subpage called on this page. * (Legacy support) If this is true, then do not reduce the 'home' urlsegment * to an empty link */ - public function updateRelativeLink(&$base, &$action) + public function updateRelativeLink(&$link, $base, $action) { } }