From 87fbd5f7816ce0924edf544bd3d165d21888c88f Mon Sep 17 00:00:00 2001 From: Lee Bradley Date: Mon, 9 Jan 2017 12:45:03 +0000 Subject: [PATCH] Fix for v4: Admin returns "Too many pages" for subpages below top level (#6464) * Fix for v4: Admin returns "Too many pages" for subpages below top level Simple logic error during porting to new version it appears * V4: LeftAndMain::getSiteTreeFor() returning space & New line in link The "Too many pages" "View as list" link had a return & tab characters in it * V4: LeftAndMain::getSiteTreeFor() fixes link for list view "Too many pages" link pointed to `?view=list` which is just normal hierarchy. Value had been updated to "listview" in #8c87ea6b --- admin/code/LeftAndMain.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 32e50c13b..1cd5e5516 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -1188,7 +1188,7 @@ class LeftAndMain extends Controller implements PermissionProvider $nodeCountCallback = function ($parent, $numChildren) use (&$controller, $className, $nodeThresholdLeaf) { if ($className !== 'SilverStripe\\CMS\\Model\\SiteTree' || !$parent->ID - || $numChildren >= $nodeThresholdLeaf + || $numChildren <= $nodeThresholdLeaf ) { return null; } @@ -1199,8 +1199,7 @@ class LeftAndMain extends Controller implements PermissionProvider _t('LeftAndMain.TooManyPages', 'Too many pages'), Controller::join_links( $controller->LinkWithSearch($controller->Link()), - ' - ?view=list&ParentID=' . $parent->ID + '?view=listview&ParentID=' . $parent->ID ), _t( 'LeftAndMain.ShowAsList',