mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
FIX: If no parent in RelativeLink() return null
This commit is contained in:
parent
3a028ac1ec
commit
de96188c8a
@ -645,7 +645,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
if ((!$parent || !$parent->exists()) && !$this->isOnDraft()) {
|
if ((!$parent || !$parent->exists()) && !$this->isOnDraft()) {
|
||||||
$parent = Versioned::get_latest_version(self::class, $this->ParentID);
|
$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()) {
|
} elseif (!$action && $this->URLSegment == RootURLController::get_homepage_link()) {
|
||||||
// Unset base for root-level homepages.
|
// Unset base for root-level homepages.
|
||||||
// Note: Homepages with action parameters (or $action === true)
|
// Note: Homepages with action parameters (or $action === true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user