From 919a8c21c3601d99438fe6287140461619fd4073 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Wed, 31 Jul 2013 14:12:08 +1200 Subject: [PATCH] FIX: pass controller as reference inside closure. Non referenced causes segfaults on PHP <= 5.3.8 environments when opening subtrees in the CMS. Likely the cause of silverstripe-cms/issues/803. --- admin/code/LeftAndMain.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 5e379f327..44a9e2d56 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -830,7 +830,7 @@ class LeftAndMain extends Controller implements PermissionProvider { // match the filter criteria until they're queried (and matched up with previously marked nodes). $nodeThresholdLeaf = Config::inst()->get('Hierarchy', 'node_threshold_leaf'); if($nodeThresholdLeaf && !$filterFunction) { - $nodeCountCallback = function($parent, $numChildren) use($controller, $className, $nodeThresholdLeaf) { + $nodeCountCallback = function($parent, $numChildren) use(&$controller, $className, $nodeThresholdLeaf) { if($className == 'SiteTree' && $parent->ID && $numChildren > $nodeThresholdLeaf) { return sprintf( '