[Résolu] After updating to WP 6.6 the Layouts Menu Cell breaks
This support ticket is created Il y a 4 mois et 2 semaines. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I am trying to: update a site built with Toolset Layouts to WordPress 6.6
Link to a page where the issue can be seen: dev site, visible on all pages as it happens in the main menu
I expected to see: functioning dropdowns in the menu
Instead, I got: no dropdowns appear in the menu
Until recently I have built a lot of sites with Toolset Layouts on the Toolset Starter Theme built by Beda.
So I still have several customers whose website run on this theme with Toolset Layout based builds.
One of those sites I updated yesterday to WordPOress 6.6 and this broke the Menu cell providing the main menu. The main menu is multy level. The top level menu items that have children don't show their sub-menus anymore.
Looking in the page source I see the whole ul class=ddl-dropdown-menu is missing there.
I reverted the live site back to WordPress 6.5.5 which brought back the sub-menus.
I have a copy of the site on a dev server that I want to use to debug this issue.
I can grant Toolset Support access to this dev site.
Additional info 1: Reading the release notes of WordPress 6.6 I saw the update contains an update of jQuery UI to version 1.13. As the menu problem looks like a Javascript issue I thought I'd drop this here as a possible clue.
Additional info 2: I have also seen this effect of the update to WP 6.6 on a site built with the Minimax theme (that was the one Beda built) with Toolset Layouts. Same issue: dropdown menu's not opening. Reverted to WP 6.5.5 fixed the issue for now.
The problem arises because of a very modest change in core WP, using a === comparison where it used to have a == comparison, such that the comparison now fails because a string ("0") is being compared with 0.
The change is in wp-includes/class-wp-walker.php:150:
// Descend only when the depth is right and there are children for this element.
if ( ( 0 === $max_depth || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {
We can't change the core file, but we will apply the change where we call this code, in layouts/inc/cell_types/wpddl.cell_menu.class.php:320, so that we force the $max_depth argument to be an integer.
So you can open the file layouts/inc/cell_types/wpddl.cell_menu.class.php:320 and navigate to line #320 and replace the existing line of code with the following line:
Thank you Minesh for your quick response and hotfix. I tested the fix and it works as you said. I will now apply this to all other sites that I manage that use the Layouts Menu Cell, and I will keep an eye on the next Layouts update.