Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Patch adds reset cache after a successful save operation.
Comment | File | Size | Author |
---|---|---|---|
#1 | save-reset-cache-1.patch | 448 bytes | amitaibu |
save-reset-cache.patch | 483 bytes | amitaibu | |
Comments
Comment #1
amitaibuAnd this time, with the correct patch.
Comment #2
fagoUsually this is not necessary, due to the way php5 deals with objects. If there is a static the cache, the object in the cache is the same as the updated one - thus any changes should be already there. However, this is indeed problematic if you have an entity serialized, e.g. form storage and do an update then + in some other cases as well.
The same issue applies to core though, at least for node_save(). See the related issue #651240: Allow modules to react to changes to an entity.
Comment #3
fagoI just ran over another issue with the static cache: Clearing the cache in the delete hook doesn't properly work, e.g. calling menu_rebuild() - as in the hook the static cache is still available. That already caused issues in profile2.
The same though applies to the 'insert' and 'update' hooks - the changes should already be applied once the hooks are invoked. Thus we need to clear the cache before invoking the hook.
Follow-up: Create an issue to fix static-cache clears in core.