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.
See below hook for Entity module. IMO the menu_cache_clear_all() is always cleared, which is mostly unnecessary.
Isn't there a way to discover WHEN this is needed?
/**
* Implements hook_entity_update().
*/
function taxonomy_menu_trails_entity_update($entity, $type) {
switch ($type) {
case 'node':
//TODO replace with specific cache entries deleting
menu_cache_clear_all();
break;
//TODO other entity types support
}
}
Comments
Comment #1
johnvAlso, when running 2 node-bulk updates parallel, chances are high to get the following error:
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {cache_menu}; Array ( ) in cache_clear_all() (line 169 of ...\includes\cache.inc).
Comment #2
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedThanks for your bug report! Calls to menu_cache_clear_all() are not necessary anymore on 7.x-2.x (they were on 7.x-1.x). Fix committed and dev version will be packaged in the next 12 hours.
About deadlock issue you've mentioned. Function cache_clear_all() is not called from menu_cache_clear_all(), so these issues are not related. And Taxonomy Menu Trails doesn't call this function directly or indirectly (maybe I'm wrong?), so it's not this module's fault. Try to use xdebug debugging session with parallel non-xdebug session to find the reason of deadlock.
Comment #3
johnvOK, thanx for the quick response!