aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/annotations.php7
-rw-r--r--engine/lib/elgglib.php3
2 files changed, 9 insertions, 1 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 666b83309..b18475d57 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -1146,6 +1146,7 @@ function delete_annotation($id) {
* Clear all the annotations for a given entity, assuming you have access to that metadata.
*
* @param int $guid
+ * @return number of annotations deleted or false if an error
*/
function clear_annotations($guid, $name = "") {
global $CONFIG;
@@ -1154,6 +1155,10 @@ function clear_annotations($guid, $name = "") {
if (!empty($name)) {
$name = get_metastring_id($name);
+ if ($name === false) {
+ // name doesn't exist so 0 rows were deleted
+ return 0;
+ }
}
$entity_guid = (int) $guid;
@@ -1173,6 +1178,8 @@ function clear_annotations($guid, $name = "") {
return delete_data($query);
}
}
+
+ return FALSE;
}
/**
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 9b5b34d86..c6a03cc4f 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2757,6 +2757,7 @@ function elgg_boot() {
function elgg_api_test($hook, $type, $value, $params) {
global $CONFIG;
$value[] = $CONFIG->path . 'engine/tests/api/entity_getter_functions.php';
+ $value[] = $CONFIG->path . 'engine/tests/regression/trac_bugs.php';
return $value;
}
@@ -2774,4 +2775,4 @@ define('ELGG_ENTITIES_NO_VALUE', 0);
register_elgg_event_handler('init', 'system', 'elgg_init');
register_elgg_event_handler('boot', 'system', 'elgg_boot', 1000);
-register_plugin_hook('unit_test', 'system', 'elgg_api_test'); \ No newline at end of file
+register_plugin_hook('unit_test', 'system', 'elgg_api_test');