aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 29c347690..dfb7492b0 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1492,8 +1492,24 @@
global $CONFIG;
$guid = (int)$guid;
- return update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='yes' where guid={$guid}");
+ // Override access only visible entities
+ $access_status = access_get_show_hidden_status();
+ access_show_hidden_entities(true);
+
+ if ($entity = get_entity($guid)) {
+ if (trigger_elgg_event('delete',$entity->type,$entity)) {
+ if ($entity->canEdit()) {
+
+ access_show_hidden_entities($access_status);
+
+ return update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='yes' where guid={$guid}");
+ }
+ }
+ }
+
+ access_show_hidden_entities($access_status);
+ return false;
}
/**