mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
API Move updateRelativeLink hook after concatination (#2770)
* move updateRelativeLink hook after concatination to make it actually updatable * keep existing parameters the same * revert to link parameter be first * update updateRelativeLink method signature in SiteTreeExtension * don't pass old parameters by reference
This commit is contained in:
parent
f9a19e7429
commit
1711c0c88e
@ -688,15 +688,17 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
$base = $this->URLSegment;
|
$base = $this->URLSegment;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->extend('updateRelativeLink', $base, $action);
|
|
||||||
|
|
||||||
// Legacy support: If $action === true, retain URLSegment for homepages,
|
// Legacy support: If $action === true, retain URLSegment for homepages,
|
||||||
// but don't append any action
|
// but don't append any action
|
||||||
if ($action === true) {
|
if ($action === true) {
|
||||||
$action = null;
|
$action = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Controller::join_links($base, '/', $action);
|
$link = Controller::join_links($base, '/', $action);
|
||||||
|
|
||||||
|
$this->extend('updateRelativeLink', $link, $base, $action);
|
||||||
|
|
||||||
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,13 +75,15 @@ abstract class SiteTreeExtension extends DataExtension
|
|||||||
* before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()}
|
* before {@link SiteTree::RelativeLink()} calls {@link Controller::join_links()}
|
||||||
* on the $base and $action
|
* 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
|
* 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
|
* (Legacy support) If this is true, then do not reduce the 'home' urlsegment
|
||||||
* to an empty link
|
* to an empty link
|
||||||
*/
|
*/
|
||||||
public function updateRelativeLink(&$base, &$action)
|
public function updateRelativeLink(&$link, $base, $action)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user