Skip to content
This repository
Browse code

BUGFIX: Fixed page tree view

  • Loading branch information...
commit e7ecdf4b350b9b846ca735fe26f4b377bcccbcbf 1 parent bfe354d
Sam Minnée authored June 15, 2012

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. 9  code/controllers/CMSMain.php
9  code/controllers/CMSMain.php
@@ -701,8 +701,8 @@ public function ListViewForm() {
701 701
 
702 702
 		$controller = $this;
703 703
 		$columns->setFieldFormatting(array(
704  
-			'listChildrenLink' => function(&$item) use($controller) {
705  
-				$num = $item->numChildren();
  704
+			'listChildrenLink' => function($value, &$item) use($controller) {
  705
+				$num = $item ? $item->numChildren() : null;
706 706
 				if($num) {
707 707
 					return sprintf(
708 708
 						'<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() {
712 712
 					);
713 713
 				}
714 714
 			},
715  
-			'getTreeTitle' => '<a class=\"cms-panel-link\" href=\"' . 
716  
-				singleton('CMSPageEditController')->Link('show') . '/$ID\">$value</a>'
  715
+			'getTreeTitle' => function($value, &$item) use($controller) {
  716
+				return '<a class="cms-panel-link" href="' . $controller->Link('show') . '/' . $item->ID . '">' . $item->TreeTitle . '</a>';
  717
+			}
717 718
 		));
718 719
 		
719 720
 		$listview = new Form(

0 notes on commit e7ecdf4

Please sign in to comment.
Something went wrong with that request. Please try again.