Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There have been a number of cases where contrib modules call field_attach_update() to update field values without saving an entity. This leads to stale caches unless the contrib module manually resets the cache.
The documentation for field_attach_update() should mention that caches need to be cleared.
See this issue in the Entity Cache queue for details:
#1966164: Consider implementing hook_field_attach_update() to clear cache when field values are updated
Comment | File | Size | Author |
---|---|---|---|
d7-document-field-attach-update-cache.patch | 608 bytes | milesw | |
Comments
Comment #1
milesw CreditAttribution: milesw commentedTagging
Comment #2
rp7 CreditAttribution: rp7 commentedI totally agree.
Comment #3
parthipanramesh CreditAttribution: parthipanramesh commentedGood idea to note that!
Comment #4
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/ccec3e9
Not totally sure that calling field_attach_update() outside an entity save is a good idea, but then again, the patch isn't specifically recommending it either :)