diff options
author | cash <cash.costello@gmail.com> | 2013-03-06 16:51:20 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2013-03-06 16:51:20 -0500 |
commit | 2dbb9772881131f5739bae2d1ce5955587e9ab78 (patch) | |
tree | 28fbf76261692964e9391134c3cf06da022f879a /engine/lib/annotations.php | |
parent | 6955850778c68412983e2acf4b26f4bece199eae (diff) | |
download | elgg-2dbb9772881131f5739bae2d1ce5955587e9ab78.tar.gz elgg-2dbb9772881131f5739bae2d1ce5955587e9ab78.tar.bz2 |
Fixes #4393 working around the overloaded 'count' parameter
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r-- | engine/lib/annotations.php | 16 |
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); } |