aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-05-11 07:01:55 -0700
committerCash Costello <cash.costello@gmail.com>2013-05-11 07:01:55 -0700
commitd6166b326ea6f25c477e2f47e9e8aef6a2af2597 (patch)
treedf8d1bbcbd4866a0d11850f26349aefb29b56201 /engine/lib/entities.php
parent4bd919e25319c75c199490f1f064643c5df799ff (diff)
parent4129637ba28113cea9b27a9644d51354f67e9f55 (diff)
downloadelgg-d6166b326ea6f25c477e2f47e9e8aef6a2af2597.tar.gz
elgg-d6166b326ea6f25c477e2f47e9e8aef6a2af2597.tar.bz2
Merge pull request #5427 from cash/enabled_annotations
Fixes #5418 adds enabled clause for annotations
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index cb972b282..15ab1170e 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1619,8 +1619,8 @@ function disable_entity($guid, $reason = "", $recursive = true) {
/**
* Enable an entity.
*
- * @warning In order to enable an entity using ElggEntity::enable(),
- * you must first use {@link access_show_hidden_entities()}.
+ * @warning In order to enable an entity, you must first use
+ * {@link access_show_hidden_entities()}.
*
* @param int $guid GUID of entity to enable
* @param bool $recursive Recursively enable all entities disabled with the entity?
@@ -1748,6 +1748,10 @@ function delete_entity($guid, $recursive = true) {
elgg_set_ignore_access($ia);
}
+ $entity_disable_override = access_get_show_hidden_status();
+ access_show_hidden_entities(true);
+ $ia = elgg_set_ignore_access(true);
+
// Now delete the entity itself
$entity->deleteMetadata();
$entity->deleteOwnedMetadata();
@@ -1755,6 +1759,9 @@ function delete_entity($guid, $recursive = true) {
$entity->deleteOwnedAnnotations();
$entity->deleteRelationships();
+ access_show_hidden_entities($entity_disable_override);
+ elgg_set_ignore_access($ia);
+
elgg_delete_river(array('subject_guid' => $guid));
elgg_delete_river(array('object_guid' => $guid));
remove_all_private_settings($guid);