From 2dbb9772881131f5739bae2d1ce5955587e9ab78 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 6 Mar 2013 16:51:20 -0500 Subject: Fixes #4393 working around the overloaded 'count' parameter --- engine/lib/annotations.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engine/lib/annotations.php') 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); } -- cgit v1.2.3