Resetting an entity_load cache bin in Drupal 7 can have more drastic consequences than in previous versions of Drupal, as we can have persistent load caches in place of the PHP static memory cache.

Instead, wherever possible, only flush the necessary entities from the cache, using entity_get_controller($entity_type)->resetCache(array($entity_id));

In this instance we surely only care about whether or not the node we are loading is obtained from the entity load cache; yet if $reset is passed then the entire node cache is purged!

Thankfully no code in menu_node itself calls menu_node_get_node() with the reset flag set, but other modules or custom code using menu_node might be doing so.

Comments

jweowu created an issue. See original summary.

jweowu’s picture

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Seems legit.

This module is seeking a new maintainer.

vuil’s picture

vuil’s picture

  • vuil committed b3c8ec6 on 7.x-1.x authored by jweowu
    Issue #2986748 by jweowu, vuil, agentrickard: Don't use $reset flag with...
vuil’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
vuil’s picture

Status: Patch (to be ported) » Fixed

I close the issue as Fixed.

Status: Fixed » Closed (fixed)

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