aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/river.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 133ef6de9..33f34360e 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -387,14 +387,16 @@ function _elgg_prefetch_river_entities(array $river_items) {
$guids[$item->object_guid] = true;
}
}
- // avoid creating oversized query
- // @todo how to better handle this?
- $guids = array_slice($guids, 0, 300, true);
- // return value unneeded, just priming cache
- elgg_get_entities(array(
- 'guids' => array_keys($guids),
- 'limit' => 0,
- ));
+ if ($guids) {
+ // avoid creating oversized query
+ // @todo how to better handle this?
+ $guids = array_slice($guids, 0, 300, true);
+ // return value unneeded, just priming cache
+ elgg_get_entities(array(
+ 'guids' => array_keys($guids),
+ 'limit' => 0,
+ ));
+ }
// prefetch object containers
$guids = array();
@@ -404,11 +406,13 @@ function _elgg_prefetch_river_entities(array $river_items) {
$guids[$object->container_guid] = true;
}
}
- $guids = array_slice($guids, 0, 300, true);
- elgg_get_entities(array(
- 'guids' => array_keys($guids),
- 'limit' => 0,
- ));
+ if ($guids) {
+ $guids = array_slice($guids, 0, 300, true);
+ elgg_get_entities(array(
+ 'guids' => array_keys($guids),
+ 'limit' => 0,
+ ));
+ }
}
/**