Permalink
Browse files

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.
  • Loading branch information...
1 parent bacf0f6 commit 919a8c21c3601d99438fe6287140461619fd4073 @wilr wilr committed Jul 31, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 admin/code/LeftAndMain.php
View
2 admin/code/LeftAndMain.php
@@ -830,7 +830,7 @@ public function getSiteTreeFor($className, $rootID = null, $childrenMethod = nul
// 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(
'<ul><li class="readonly"><span class="item">'

0 comments on commit 919a8c2

Please sign in to comment.