aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 23:52:15 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 23:52:15 +0000
commit36905b66bbffb985bf3756595d83ff7050cef583 (patch)
tree4913c021b1542ec52bebfb243031fbc8b8190a2a
parent7a217d76ab5eba957486333f861b45ad8ba08f21 (diff)
downloadelgg-36905b66bbffb985bf3756595d83ff7050cef583.tar.gz
elgg-36905b66bbffb985bf3756595d83ff7050cef583.tar.bz2
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
-rw-r--r--engine/classes/ElggBatch.php2
1 files changed, 2 insertions, 0 deletions
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);