BUG: dependentPages grid field not showing necessary columns and their values.

This commit is contained in:
Normann Lou 2013-01-08 11:34:25 +13:00 committed by Ingo Schommer
parent ffc6d6ffad
commit f674af0c73

View File

@ -1666,24 +1666,36 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// We merge all into a regular SS_List, because DataList doesn't support merge // We merge all into a regular SS_List, because DataList doesn't support merge
if($contentLinks = $this->BackLinkTracking()) { if($contentLinks = $this->BackLinkTracking()) {
foreach($contentLinks as $item) $item->DependentLinkType = 'Content link'; $linkList = new ArrayList();
$items->merge($contentLinks); foreach($contentLinks as $item) {
$item->DependentLinkType = 'Content link';
$linkList->push($item);
}
$items->merge($linkList);
} }
// Virtual pages // Virtual pages
if($includeVirtuals) { if($includeVirtuals) {
$virtuals = $this->VirtualPages(); $virtuals = $this->VirtualPages();
if($virtuals) { if($virtuals) {
foreach($virtuals as $item) $item->DependentLinkType = 'Virtual page'; $virtualList = new ArrayList();
$items->merge($virtuals); foreach($virtuals as $item) {
$item->DependentLinkType = 'Virtual page';
$virtualList->push($item);
}
$items->merge($virtualList);
} }
} }
// Redirector pages // Redirector pages
$redirectors = DataObject::get("RedirectorPage", "\"RedirectorPage\".\"RedirectionType\" = 'Internal' AND \"LinkToID\" = $this->ID"); $redirectors = DataObject::get("RedirectorPage", "\"RedirectorPage\".\"RedirectionType\" = 'Internal' AND \"LinkToID\" = $this->ID");
if($redirectors) { if($redirectors) {
foreach($redirectors as $item) $item->DependentLinkType = 'Redirector page'; $redirectorList = new ArrayList();
$items->merge($redirectors); foreach($redirectors as $item) {
$item->DependentLinkType = 'Redirector page';
$redirectorList->push($item);
}
$items->merge($redirectorList);
} }
if(class_exists('Subsite')) Subsite::disable_subsite_filter($origDisableSubsiteFilter); if(class_exists('Subsite')) Subsite::disable_subsite_filter($origDisableSubsiteFilter);
@ -1793,6 +1805,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$dependentPages $dependentPages
); );
$dependentTable->getConfig()->getComponentByType('GridFieldDataColumns') $dependentTable->getConfig()->getComponentByType('GridFieldDataColumns')
->setDisplayFields($dependentColumns)
->setFieldFormatting(array( ->setFieldFormatting(array(
'Title' => '<a href=\"admin/pages/edit/show/$ID\">$Title</a>', 'Title' => '<a href=\"admin/pages/edit/show/$ID\">$Title</a>',
'AbsoluteLink' => '<a href=\"$value\">$value</a>', 'AbsoluteLink' => '<a href=\"$value\">$value</a>',