From 1b2a453410488addb98d8c7f769bfd29720093df Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 8 Dec 2009 12:46:53 +0000 Subject: fixes #1305 - user and entity cache now cleared on delete git-svn-id: http://code.elgg.org/elgg/trunk@3743 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine/lib/entities.php') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index ef99f764a..f86299c6e 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -2399,13 +2399,18 @@ function enable_entity($guid) { * Note: this bypasses ownership of sub items. */ function delete_entity($guid, $recursive = true) { - global $CONFIG; + global $CONFIG, $ENTITY_CACHE; $guid = (int)$guid; if ($entity = get_entity($guid)) { if (trigger_elgg_event('delete', $entity->type, $entity)) { if ($entity->canEdit()) { + // delete cache + if (isset($ENTITY_CACHE[$guid])) { + invalidate_cache_for_entity($guid); + } + // Delete contained owned and otherwise releated objects (depth first) if ($recursive) { // Temporary token overriding access controls TODO: Do this better. -- cgit v1.2.3