diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-01 16:21:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-01 16:21:36 +0000 |
commit | 237caef7b9358b08e75145a6c4fec53ad04cb7b1 (patch) | |
tree | 5bebc1bc970f196c7ab23757404265291527ca3c /engine/lib | |
parent | ccf6312af1845f1be9c25e849a5c9d8136a7caa4 (diff) | |
download | elgg-237caef7b9358b08e75145a6c4fec53ad04cb7b1.tar.gz elgg-237caef7b9358b08e75145a6c4fec53ad04cb7b1.tar.bz2 |
Fixes #1558: Applied Cash's patch. Added unit tests to test for regressions for any bugs fixed in trac.
git-svn-id: http://code.elgg.org/elgg/trunk@3979 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/annotations.php | 7 | ||||
-rw-r--r-- | engine/lib/elgglib.php | 3 |
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'); |