Permalink
Browse files

BUGFIX: Fixed page tree view

  • Loading branch information...
1 parent bfe354d commit e7ecdf4b350b9b846ca735fe26f4b377bcccbcbf @sminnee sminnee committed Jun 15, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 code/controllers/CMSMain.php
@@ -701,8 +701,8 @@ public function ListViewForm() {
$controller = $this;
$columns->setFieldFormatting(array(
- 'listChildrenLink' => function(&$item) use($controller) {
- $num = $item->numChildren();
+ 'listChildrenLink' => function($value, &$item) use($controller) {
+ $num = $item ? $item->numChildren() : null;
if($num) {
return sprintf(
'<a class="cms-panel-link list-children-link" data-pjax-target="ListViewForm,Breadcrumbs" href="%s?ParentID=%d&view=list">%s</a>',
@@ -712,8 +712,9 @@ public function ListViewForm() {
);
}
},
- 'getTreeTitle' => '<a class=\"cms-panel-link\" href=\"' .
- singleton('CMSPageEditController')->Link('show') . '/$ID\">$value</a>'
+ 'getTreeTitle' => function($value, &$item) use($controller) {
+ return '<a class="cms-panel-link" href="' . $controller->Link('show') . '/' . $item->ID . '">' . $item->TreeTitle . '</a>';
+ }
));
$listview = new Form(

0 comments on commit e7ecdf4

Please sign in to comment.