From e7ecdf4b350b9b846ca735fe26f4b377bcccbcbf Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 15 Jun 2012 16:36:45 +1200 Subject: [PATCH] BUGFIX: Fixed page tree view --- code/controllers/CMSMain.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index bde6b32f..f50bafe2 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -701,8 +701,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $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( '%s', @@ -712,8 +712,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr ); } }, - 'getTreeTitle' => 'Link('show') . '/$ID\">$value' + 'getTreeTitle' => function($value, &$item) use($controller) { + return '' . $item->TreeTitle . ''; + } )); $listview = new Form(