aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r--engine/lib/annotations.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index dcb29d0ab..7f5ab93f2 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -206,7 +206,9 @@ function create_annotation($entity_guid, $name, $value, $value_type, $owner_guid
if (trigger_elgg_event('create', 'annotation', $obj)) {
return $result;
} else {
+ // plugin returned false to reject annotation
delete_annotation($result);
+ return FALSE;
}
}
}
@@ -263,6 +265,7 @@ function update_annotation($annotation_id, $name, $value, $value_type, $owner_gu
if (trigger_elgg_event('update', 'annotation', $obj)) {
return true;
} else {
+ // @todo add plugin hook that sends old and new annotation information before db access
delete_annotation($annotation_id);
}
}