mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #2260 from oetiker/patch-1
do not die if there is no parent in RelativeLink
This commit is contained in:
commit
338c512e15
@ -519,7 +519,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if((!$parent || !$parent->exists()) && $this->IsDeletedFromStage) {
|
||||
$parent = Versioned::get_latest_version('SiteTree', $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