diff --git a/code/Model/SiteTree.php b/code/Model/SiteTree.php index 8fe1c0ef..961b9b37 100755 --- a/code/Model/SiteTree.php +++ b/code/Model/SiteTree.php @@ -688,15 +688,17 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi $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 8813c61d..dd1cfab2 100644 --- a/code/Model/SiteTreeExtension.php +++ b/code/Model/SiteTreeExtension.php @@ -75,13 +75,15 @@ abstract class SiteTreeExtension extends DataExtension * 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) { } }