Patch adds reset cache after a successful save operation.

CommentFileSizeAuthor
#1 save-reset-cache-1.patch448 bytesamitaibu
save-reset-cache.patch483 bytesamitaibu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

FileSize
448 bytes

And this time, with the correct patch.

fago’s picture

Usually 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.

fago’s picture

Status: Needs review » Fixed

I 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.