Skip to content

Menu rebuild on module enable reverts moved menu links to their default menus #7066

@alanmels

Description

@alanmels

Description of the bug

Enabling any module triggers a menu rebuild that can undo previously moved menu links (and their children) by relocating them back to their original menu, breaking custom menu structures even when the enabled module doesn’t change menus.

Steps To Reproduce

  1. Go to /admin/structure/menu/manage/management and move system-provided links (e.g., “Add content” and its children Card/Page/Post) from the default Administration/management menu into main-menu; save.
  2. Confirm the links now appear in main-menu.
  3. Enable an unrelated module (e.g., devel) via /admin/modules or drush en devel.
  4. After enable completes, revisit /admin/structure/menu/manage/main-menu.

Actual behavior

Some or all moved links (e.g., Card/Page/Post under “Add content”) disappear from main-menu because the enable-time menu rebuild reassigns them back to their default menu. Parent links that were marked customized may remain, while unmarked children revert.

Expected behavior

Enabling a module should not alter existing menu placement. Links moved by a site admin should remain in their chosen menus (including children) after any module enable.

Additional information

  • Notes: Backdrop performs a menu rebuild on module enable. Links not marked customized=1 can be reset to their router-default menu during that rebuild.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions