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

  1. In a profile, disable the four Menu islands: Main menu items, Delete, Preset and Styles menu.
  2. Open a builder using that profile.
  3. The browser console shows the error.

Proposed resolution

Move the dbContextualMenu once() into contextual_menu.js, next to the function it calls.

Remaining tasks

  1. Fix.
  2. Playwright test: a profile without Menu islands loads with no page error.
Command icon 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

mogtofu33 created an issue. See original summary.

  • mogtofu33 committed 48ce7da8 on 1.0.x
    fix: #3635797 JS error when a profile enables no Menu island
    
    By:...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Active » Fixed

Small js fix that do not require review imho.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)

Shipped in beta10 release.