mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed case where SiteTree->getCMSFields() is missing a parent page, and thus it results in a non-object
MINOR Removed unused variable $parentPageTitle, and added missing array that wasn't defined (but used later on causing an undefined variable error) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76948 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c0ae471423
commit
60623a42c3
@ -1128,18 +1128,20 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if($this->ID && is_numeric($this->ID)) {
|
||||
$linkedPages = DataObject::get("VirtualPage", "CopyContentFromID = $this->ID");
|
||||
}
|
||||
|
||||
$parentPageLinks = array();
|
||||
|
||||
if(isset($linkedPages)) {
|
||||
foreach($linkedPages as $linkedPage) {
|
||||
$parentPage = $linkedPage->Parent;
|
||||
$parentPageTitle = $parentPage->Title;
|
||||
|
||||
if($parentPage->ID) {
|
||||
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">{$parentPage->Title}</a>";
|
||||
} else {
|
||||
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">" .
|
||||
_t('SiteTree.TOPLEVEL', 'Site Content (Top Level)') .
|
||||
"</a>";
|
||||
if($parentPage) {
|
||||
if($parentPage->ID) {
|
||||
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">{$parentPage->Title}</a>";
|
||||
} else {
|
||||
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">" .
|
||||
_t('SiteTree.TOPLEVEL', 'Site Content (Top Level)') .
|
||||
"</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user