mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #2504 from amolswnz/hotfix/2502
FIX: If no parent in RelativeLink() return null
This commit is contained in:
commit
c127b30bcf
@ -645,7 +645,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
||||
if ((!$parent || !$parent->exists()) && !$this->isOnDraft()) {
|
||||
$parent = Versioned::get_latest_version(self::class, $this->ParentID);
|
||||
}
|
||||
$base = $parent->RelativeLink($this->URLSegment);
|
||||
$base = $parent ? $parent->RelativeLink($this->URLSegment) : null;
|
||||
} elseif (!$action && $this->URLSegment == RootURLController::get_homepage_link()) {
|
||||
// Unset base for root-level homepages.
|
||||
// Note: Homepages with action parameters (or $action === true)
|
||||
|
Loading…
Reference in New Issue
Block a user