aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-03-12 11:15:00 -0700
committerSteve Clay <steve@mrclay.org>2013-03-12 11:15:00 -0700
commit329620b0f667d3283ef2d932760264110c4cfaad (patch)
tree11b2d031c2b22fff4da33302765d9ee2696df14e /engine
parenta313f38890eec3b870c94476a79afce7d606c222 (diff)
parentcf04d05bd44cd2ac935b6ed14c7af85e58aa7d17 (diff)
downloadelgg-329620b0f667d3283ef2d932760264110c4cfaad.tar.gz
elgg-329620b0f667d3283ef2d932760264110c4cfaad.tar.bz2
Merge pull request #5223 from mrclay/5214-18
Fixes #5214: Successfully invalidates metadata cache in some corner cases
Diffstat (limited to 'engine')
-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;
}
/**