Generated with the help of an LLM.
Problem/Motivation
A profile with no Menu island throws Drupal.displayBuilder.menuAlterHtmxEvents is not a function on each builder page load.
display_builder.js calls it in every builder, but contextual_menu.js defines it, and that script only loads with the contextual menu.
Nothing else breaks, but the error lands in the console of every such builder.
Steps to reproduce
- In a profile, disable the four Menu islands: Main menu items, Delete, Preset and Styles menu.
- Open a builder using that profile.
- The browser console shows the error.
Proposed resolution
Move the dbContextualMenu once() into contextual_menu.js, next to the function it calls.
Remaining tasks
- Fix.
- Playwright test: a profile without Menu islands loads with no page error.
Issue fork display_builder-3635797
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:
Comments
Comment #4
mogtofu33 commentedSmall js fix that do not require review imho.
Comment #6
pdureau commentedShipped in beta10 release.