From 36905b66bbffb985bf3756595d83ff7050cef583 Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 13 Feb 2011 23:52:15 +0000 Subject: If using a callback in ElggBatch, make sure there's an initial value to return. git-svn-id: http://code.elgg.org/elgg/trunk@8212 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggBatch.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engine/classes/ElggBatch.php') diff --git a/engine/classes/ElggBatch.php b/engine/classes/ElggBatch.php index 96a35f238..4f8f6cae9 100644 --- a/engine/classes/ElggBatch.php +++ b/engine/classes/ElggBatch.php @@ -172,6 +172,8 @@ class ElggBatch if ($callback && is_callable($callback)) { $batch = new ElggBatch($getter, $options, null, $chunk_size); + $all_results = null; + foreach ($batch as $result) { if (is_string($callback)) { $result = $callback($result, $getter, $options); -- cgit v1.2.3