aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt1
-rw-r--r--engine/lib/relationships.php8
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index e544352ec..43d4cc9ff 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -40,6 +40,7 @@ http://code.elgg.org/elgg/.....
* Deprecated search_list*().
* Added elgg_deprecated_notice().
* ElggEntity::countEntitiesFromRelationship() supports inverse relationships. #1325
+ * delete_relationship() triggers the hook delete:relationship and passes the relationship object. #1213
Services API:
* Separated user and api authenticate processing
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 979d3ea67..789dd4575 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -333,9 +333,13 @@ function delete_relationship($id) {
$id = (int)$id;
- $result = delete_data("delete from {$CONFIG->dbprefix}entity_relationships where id=$id");
+ $relationship = get_relationship($id);
- return $result;
+ if (trigger_elgg_event('delete', 'relationship', $relationship)) {
+ return delete_data("delete from {$CONFIG->dbprefix}entity_relationships where id=$id");
+ }
+
+ return FALSE;
}
/**