We are using Drupal 8.

We have a menu with several top level items and then sub-menus under each element.

All the children for a given parent should expand when the parent is selected.

It works... most of the time then some times it does not... I can see no pattern to it. Clearing the site cache usually fixes it for a period but then the problem will return.

Sometimes it will take days to reoccur other times it will take 5 min.

I cannot see any errors in the php error log file and no javascript errors being reported by the browser. Users on my network and elsewhere seem to be affected.

Can anyone give guidance as to what may be producing such an error? Is this a common error?

A 'sometimes' working menu is not really acceptable but locking it open is sub-optimal also as there are lots of children.

Comments

VM’s picture

theme in use? if not a core theme, have you tested in a core theme?

gobnat’s picture

It is our own custom theme.

No I have not tested it on a plain core theme but our theme is based on on Drupal Core (Stable). We have changed very little in regards to menus - possibly only added a class or two and some javascript to add/remove css styling depending on what is open. We also use a small amount of bootstrap on the site. We load it in as a library though and call as needed in templates, we are not using a bootstrap sub-theme.

The difficulty for us is that this issue has arisen on our live server - which we obviously cannot switch to a generic theme - and does not appear to occur when we spin up a test server - at least not that we have notice so far. It is also very sporadic and we have not found a trigger for it yet.

The Menu in question is just a basic core menu with 1-2 sets of children. Nothing much else has been done to it.

gobnat’s picture

Am I really the only person who has had this problem?

Still happening and no idea how to fix it.

I can add the following from experimentation though:

a) Sometimes clearing the site cache causes the issue...
b) Clearing it 2-3 times seems to always fix it....

help...

Jeff Burnz’s picture

No one really knows what you mean by "All the children for a given parent should expand when the parent is selected." Thats the issue here, you're not being really clear about what the actual problem is. Maybe linking to the site and telling us where to observe and how to reproduce the problem will help a lot.

gobnat’s picture

Maybe linking to the site and telling us where to observe and how to reproduce the problem will help a lot.

My apologies for not being clear, I will try to expand on the issue.

It is the grey/orange menu in the left sidebar: https://tenants.org.au/tu

As for reproducing the error, that is part of the problem. I cannot reliably get it to happen. I get user reports of the menu being broken every few days or weeks (Which I confirm ) and then I can usually fix the problem by clearing the site cache 2-3 times. Sometimes I can cause the issue by clearing the cache (single clear) but not reliably.

This may not be relevant but I will add that most of my error reports come from within my workplace - where we all share an IP - whether or not that is an issue I am not sure. I have confirmed by visiting the site externally during a period of the menu not working that the problem is not only from that one IP address.

The page is still under development to some extent so changes are getting made reasonably often, however major changes should mostly be complete.

The menu should behave as follows:

1) https://tenants.org.au/tu

item a
item b
item c

2) A top level page: https://tenants.org.au/tu/about-us

item a <--- active page
    sub-item a
    sub-item b
    ...
item b
item c

3) A sub item page: https://tenants.org.au/tu/staff-and-board

item a
    sub-item a
    sub-item b <-- active page
    ...
item b
item c

When the menu breaks it remains locked in version 1 no matter what page is active.

For some further context. The webpage https://tenants.org.au/tu/ is setup to look like a sub-domain of https://tenants.org.au/ which is the larger main site but in reality it is just a set of custom content types as it is a small part of the site and should never grow very large.

Oh and one further note. I am unable to reproduce this so far when I create a local test or development version. I usually develop in vagrant with the same LAMP stack as the intended live site. Of course my local version generally has neither the traffic or the uptime of the live site.

gobnat’s picture

Pretty sure help isn't coming on this, but in case anyone is still listening one additional thing we have discovered is that using drush cache-rebuild does not seem to fix the issue when it occurs - and in fact possibly causes it - while clearing the cache from inside admin->configuration->performance->clear all caches does seem to fix the issue for a while...

gobnat’s picture

Ok then.

I have narrowed the issue down to drush.

using:

sudo drush cache-rebuild or
sudo drush cache-clear

causes the issue...

Currently the only way to fix it seems to be to go into the performance section of the admin area and manually clear all the caches.

Is there any way to clear all the caches the same way as the admin UI does from the command line? We clear the caches some times during backups and do no want to have to manually log into the site to clear the cache?

gobnat’s picture

I can't figure out what they did but the latest version of Drush - 8.1.8 seems to fix the issue...