aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-03-06 14:38:25 -0800
committerCash Costello <cash.costello@gmail.com>2013-03-06 14:38:25 -0800
commitd051e788e7ded0811dd14c6b47bcbda602737539 (patch)
tree28fbf76261692964e9391134c3cf06da022f879a /engine/lib/annotations.php
parent4b889e9cc7c629bb408fc8e470a80a7ab283fffc (diff)
parent2dbb9772881131f5739bae2d1ce5955587e9ab78 (diff)
downloadelgg-d051e788e7ded0811dd14c6b47bcbda602737539.tar.gz
elgg-d051e788e7ded0811dd14c6b47bcbda602737539.tar.bz2
Merge pull request #5203 from cash/bug_4393
Fixes the count issue with elgg_get_entities_from_annotation_calculation()
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r--engine/lib/annotations.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index f40a2cc6f..bd5ea1a1f 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -200,6 +200,18 @@ function update_annotation($annotation_id, $name, $value, $value_type, $owner_gu
* @since 1.8.0
*/
function elgg_get_annotations(array $options = array()) {
+
+ // @todo remove support for count shortcut - see #4393
+ if (isset($options['__egefac']) && $options['__egefac']) {
+ unset($options['__egefac']);
+ } else {
+ // support shortcut of 'count' => true for 'annotation_calculation' => 'count'
+ if (isset($options['count']) && $options['count']) {
+ $options['annotation_calculation'] = 'count';
+ unset($options['count']);
+ }
+ }
+
$options['metastring_type'] = 'annotations';
return elgg_get_metastring_based_objects($options);
}
@@ -425,6 +437,10 @@ function elgg_get_entities_from_annotation_calculation($options) {
$options['callback'] = 'entity_row_to_elggstar';
+ // see #4393
+ // @todo remove after the 'count' shortcut is removed from elgg_get_annotations()
+ $options['__egefac'] = true;
+
return elgg_get_annotations($options);
}