I have a navigation menu showing in both the header and footer of my site both of which are for the main navigation and are added via Blocks Layout.
In the live Drupal 8 environment the active and active trail classes work as expected for authenticated user and non-authenticated user but the resulting static html files all have the same menu item marked as the active item despite not being the correct page.
i.e. if I have Frontpage, Page A, Page B and Page C. Pages A, B and C all have menu items, frontpage does not. From the static files, frontpage shows no active menu items as expected. However whichever of the other pages you visit, Page B always gets the active class.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3024444-6.patch | 2.77 KB | samuel.mortenson |
Comments
Comment #2
samuel.mortensonThanks for the issue @jamestamr! This is an unfortunate side-effect of a performance enhancement Tome uses to process multiple requests in one Drupal bootstrap. When you run
drush tome:staticit spawns five processes, with each process handling five requests. Drupal isn't totally designed to handle multiple requests in one bootstrap/process so I've had to work through a few bugs like this as they come in.I've replicated this bug but don't have a solution yet - in the meantime you can run
drush tome:static --path-count=1, which in my testing avoids this problem and properly adds the active trail class to menu items.Comment #3
jamestombs commentedNot been able to get tome drush commands to work, only been able to run through UI.
Drush version: 8.1.18
Comment #4
samuel.mortenson@jamestamr Drush 9 is required to run Tome commands.
Comment #5
jamestombs commentedPerfect thanks.
Comment #6
samuel.mortensonHere's a patch which should fix this problem. @jamestamr if you have time to test it out when using the user interface I'd appreciate it!
Comment #8
samuel.mortensonIt's been awhile so I'm just going to commit - thanks!