mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-08-31 23:07:49 +02:00
BUGFIX: SiteTree#getCMSFields referenced $linkedPages even if $linkedPages wasnt set
This commit is contained in:
parent
f620f9b46c
commit
c3bf93468f
@ -1760,36 +1760,36 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
// Create a status message for multiple parents
|
||||
if($this->ID && is_numeric($this->ID)) {
|
||||
$linkedPages = $this->VirtualPages();
|
||||
}
|
||||
|
||||
$parentPageLinks = array();
|
||||
|
||||
if($linkedPages->Count() > 0) {
|
||||
foreach($linkedPages as $linkedPage) {
|
||||
$parentPage = $linkedPage->Parent;
|
||||
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>";
|
||||
$parentPageLinks = array();
|
||||
|
||||
if($linkedPages->Count() > 0) {
|
||||
foreach($linkedPages as $linkedPage) {
|
||||
$parentPage = $linkedPage->Parent;
|
||||
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>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lastParent = array_pop($parentPageLinks);
|
||||
$parentList = "'$lastParent'";
|
||||
|
||||
if(count($parentPageLinks) > 0) {
|
||||
$parentList = "'" . implode("', '", $parentPageLinks) . "' and "
|
||||
. $parentList;
|
||||
}
|
||||
|
||||
$statusMessage[] = sprintf(
|
||||
_t('SiteTree.APPEARSVIRTUALPAGES', "This content also appears on the virtual pages in the %s sections."),
|
||||
$parentList
|
||||
);
|
||||
}
|
||||
|
||||
$lastParent = array_pop($parentPageLinks);
|
||||
$parentList = "'$lastParent'";
|
||||
|
||||
if(count($parentPageLinks) > 0) {
|
||||
$parentList = "'" . implode("', '", $parentPageLinks) . "' and "
|
||||
. $parentList;
|
||||
}
|
||||
|
||||
$statusMessage[] = sprintf(
|
||||
_t('SiteTree.APPEARSVIRTUALPAGES', "This content also appears on the virtual pages in the %s sections."),
|
||||
$parentList
|
||||
);
|
||||
}
|
||||
|
||||
if($this->HasBrokenLink || $this->HasBrokenFile) {
|
||||
|
Loading…
Reference in New Issue
Block a user