diff options
author | Steve Clay <steve@mrclay.org> | 2013-03-10 23:10:48 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2013-03-10 23:10:48 -0400 |
commit | cf04d05bd44cd2ac935b6ed14c7af85e58aa7d17 (patch) | |
tree | 8c2c627b1a8c562ccbb61883ae5a14713d84c2df /engine/lib | |
parent | 42c52d51ea0e9047134441b31c8a9c7eac7922ef (diff) | |
download | elgg-cf04d05bd44cd2ac935b6ed14c7af85e58aa7d17.tar.gz elgg-cf04d05bd44cd2ac935b6ed14c7af85e58aa7d17.tar.bz2 |
Fixes #5214: Successfully invalidates metadata cache in some corner cases
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/metadata.php | 7 |
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; } /** |