aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorJanek Lasocki-Biczysko <j.lasocki-biczysko@intrallect.com>2011-11-03 13:02:30 +0000
committerJanek Lasocki-Biczysko <j.lasocki-biczysko@intrallect.com>2011-11-03 13:02:30 +0000
commitb7312bf7096401f8501086c9c4ab20478843a687 (patch)
tree86a62b3c8212f214d5b1b677cfffdb4c195302e1 /engine
parent7f8b7adeb346c8d07e2da4b72e9f78e8ffcb82b9 (diff)
downloadelgg-b7312bf7096401f8501086c9c4ab20478843a687.tar.gz
elgg-b7312bf7096401f8501086c9c4ab20478843a687.tar.bz2
Fixes 4041 (Deleted entities remain in memcache)
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/entities.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 8b3431c8a..a76ce11fe 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -410,7 +410,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null, $
$newentity_cache = new ElggMemcache('new_entity_cache');
}
if ($newentity_cache) {
- $new_entity = $newentity_cache->delete($guid);
+ $newentity_cache->delete($guid);
}
// Handle cases where there was no error BUT no rows were updated!
@@ -1489,6 +1489,15 @@ function delete_entity($guid, $recursive = true) {
if (isset($ENTITY_CACHE[$guid])) {
invalidate_cache_for_entity($guid);
}
+
+ // If memcache is available then delete this entry from the cache
+ static $newentity_cache;
+ if ((!$newentity_cache) && (is_memcache_available())) {
+ $newentity_cache = new ElggMemcache('new_entity_cache');
+ }
+ if ($newentity_cache) {
+ $newentity_cache->delete($guid);
+ }
// Delete contained owned and otherwise releated objects (depth first)
if ($recursive) {