In #2938884: A non-existent route breaks the site, an update hook was introduced to clear the router cache.
I do not recommend doing this. It has led to exceptions being thrown on a site I am working on. In general, you do not want to clear caches prior to running updb and entup operations. In a scenario like this, caches are cleared and the attempt to regenerate them is failing because pending update hooks and entity definition changes have not been executed yet. I don't think it's a rare situation to be in.
What I also find strange is that updb clears all caches after execution is complete. Why is this hook even needed?
Issue fork admin_toolbar-3046604
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3046604-update-cc
compare
Comments
Comment #2
chris matthews commented@mstef, do you experience this issue on the latest 8.x-2.x-dev?
Comment #3
romainj commentedThis was introduced because it was not obvious that you'd have to clear the router cache when updating the module. Still I agree that it should be part of any module/drupal update.
Comment #4
adriancid