aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-03-10 23:10:48 -0400
committerSteve Clay <steve@mrclay.org>2013-03-10 23:10:48 -0400
commitcf04d05bd44cd2ac935b6ed14c7af85e58aa7d17 (patch)
tree8c2c627b1a8c562ccbb61883ae5a14713d84c2df
parent42c52d51ea0e9047134441b31c8a9c7eac7922ef (diff)
downloadelgg-cf04d05bd44cd2ac935b6ed14c7af85e58aa7d17.tar.gz
elgg-cf04d05bd44cd2ac935b6ed14c7af85e58aa7d17.tar.bz2
Fixes #5214: Successfully invalidates metadata cache in some corner cases
-rw-r--r--engine/lib/metadata.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 96d446060..305e9918b 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -310,11 +310,14 @@ function elgg_delete_metadata(array $options) {
if (!elgg_is_valid_options_for_batch_operation($options, 'metadata')) {
return false;
}
+ $options['metastring_type'] = 'metadata';
+ $result = elgg_batch_metastring_based_objects($options, 'elgg_batch_delete_callback', false);
+ // This moved last in case an object's constructor sets metadata. Currently the batch
+ // delete process has to create the entity to delete its metadata. See #5214
elgg_get_metadata_cache()->invalidateByOptions('delete', $options);
- $options['metastring_type'] = 'metadata';
- return elgg_batch_metastring_based_objects($options, 'elgg_batch_delete_callback', false);
+ return $result;
}
/**