We have had an issue with an expanding menu on a drupal 8 website that stops working when the command
MORE INFO ON ERROR:
When triggered, the error causes menus set to expand some sub-menu portion when active to stop expanding. That is to say the menu stops expanding at all, just stays in the inactive state.
The menus where this occurred were generated with the core menu module.
Logging into the site and using the clear all found in admin->config->performance->"clear all caches" fixes the issue.
Can anyone suggest an alternative drush/command line command we can use or how we can fix this problem?
does not seem to fix the issue.
I also tried executing as apache:
sudo -u www-data drush cache-rebuild
this also broke my menus.
What exactly is the difference between the UI cache clear and the drush one?
Ok after some digging - and please correct me if I am wrong here - it seems that when Drush rebuilds all caches it invokes:
drupal_rebuild(ClassLoader $class_loader, Request $request)
which is found in
utility.inc, see drush github repo, while the admin command in Drupal calls:
common.inc, see drupal docs.
I have always been under the impression drush either called the same cache function as the internal performance button or at least they had the same behaviour, but they seem not to - at least in regards to my issue with the menu.
Can anyone suggest a way to have drush - or some other tool - invoke
A further question, is the behaviour I am observing intended or should drush cache-rebuild work the same as
MORE INFO AGAIN
Further experiments lead me to believe that it is specifically the clearing of the views cache that is causing some expanding menus to break.
drush cache-clear views
Will also trigger the behaviour. Again, clearing with the
drupal_flush_all_caches() via the performance admin page fixes the issue.