Layout Builder cannot be uninstalled while menu_link_content overrides exist and unable to find these overrides anywhere visually or in db

Created on 30 March 2023, about 1 year ago
Updated 16 April 2024, 3 months ago

Problem/Motivation

Attempts to remove layout_builder (drush pmu layout_builder) result in the following error:
layout_builder: The <em class="placeholder">Layout Section</em> field type is used in the following field: menu_link_content.layout_builder__layout
The problem with this is that as far as I can tell there is no method to expose menu link content to layouts within the UX.

Steps to reproduce

Using an old site that I've migrated to Drupal 9.5, perform a module uninstall of layout_builder. In doing so you are greeted with the notice above.

I attempted to manually purge data from the menu_link_content__layout_builder__layout table thinking layout data was stored here but that does not appear to address the issue.

Proposed resolution

I think this has to do with a legacy layout configuration that is not addressed in the current UX and I would propose that the field storage that is hidden somewhere be addressable and more easily found as part of the uninstall process. I'm hoping someone knows more about the layout builder ecosystem than I do and can point me to possible locations where menu_link_content may be stored.

Some possible locations are in the following tables, but I'm stuck finding the exact location.
| menu_link_content |
| menu_link_content__layout_builder__layout |
| menu_link_content_data |
| menu_link_content_field_revision |
| menu_link_content_r__4d3fa8f1db |
| menu_link_content_revision |

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated about 16 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States jlancaster

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @jlancaster
  • πŸ‡ΊπŸ‡ΈUnited States jlancaster

    In my opinion, the issue is different because #2980299 is related to the UX components and the destructive action as you perform it. In this case, I cannot find a way to expose UX elements for the element within question (menu_link_content.layout_builder__layout) to work with it and purge data.

    The simplest explanation would be that I'm simply overlooking where this could be but I have dug and dug without any success, which is why I came here and referenced the other issue because it is "kind of close but not quite" to this particular issue.

    I keep asking myself: "If there was a page to manage menu displays, where would it be?" -- I have never seen such a thing. But maybe layout builder had one at one time way back when?

  • πŸ‡ΊπŸ‡ΈUnited States maxstarkenburg

    @jlancaster, this doesn't address the general issue or explain how it might have gotten there in the first place, but curious if https://www.drupal.org/project/menu_item_extras β†’ might at least help expose the field for you (since that module makes menu items fieldable, so providing "manage display" and similar forms for menus).

  • Status changed to Postponed: needs info 3 months ago
  • πŸ‡³πŸ‡ΏNew Zealand DanielVeza Brisbane, AU

    This was is quite tough to debug and feels like it may be an issue with the particlar site.

    Out of the box Core has no way of attaching Layout Builder to Menu items so I expect some custom work was done to support that. @maxstarkenburg suggests one way that this may have been done.

    I think to progress this any further we would need steps to replicate from a fresh install of D11. I suspect that πŸ› Layout Builder cannot be uninstalled while overrides exist; no easy way to revert all overrides Needs work will mostly fix the issues that have surfaced on this particular site.

Production build 0.69.0 2024