LogicException: Missing bundle entity, entity type menu, entity id menu_link_content

Created on 13 June 2024, 13 days ago
Updated 24 June 2024, 2 days ago

Problem/Motivation

I'm getting the following error during installation when I have the Menu Item Extras β†’ module installed:

LogicException: Missing bundle entity, entity type menu, entity id menu_link_content
#0 /var/www/html/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(281): Drupal\Core\Entity\EntityType->getBundleConfigDependency('menu_link_conte...')
#1 /var/www/html/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(321): Drupal\Core\Entity\EntityDisplayBase->calculateDependencies()
#2 /var/www/html/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(270): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#3 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\Core\Entity\EntityDisplayBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#4 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\Core\Entity\Entity\EntityFormDisplay))
#5 /var/www/html/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(257): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\Core\Entity\Entity\EntityFormDisplay))
#6 /var/www/html/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\Core\Entity\Entity\EntityFormDisplay))
#7 /var/www/html/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(609): Drupal\Core\Entity\EntityBase->save()
#8 /var/www/html/modules/contrib/domain_menu_access/domain_menu_access.install(41): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#9 [internal function]: domain_menu_access_install(false)

It occurs when the module tries to save the new display in this line: https://git.drupalcode.org/project/domain_menu_access/-/blob/2.0.x/domai...

I'm using the following versions:
Drupal: 10.2.7
Menu Item Extras: 3.0.2
Domain Menu Access: 2.0.0

Steps to reproduce

  • Install menu_item_extras: drush en menu_item_extras
  • Install this module: drush en domain_menu_access
  • The error should appear in the console.
πŸ’¬ Support request
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany lmoeni

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

Comments & Activities

  • Issue created by @lmoeni
  • πŸ‡©πŸ‡ͺGermany lmoeni
  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    One workaround is to first install the domain_menu_access module and after that install the menu_item_extras.
    I'm willing to review any patches when provided.

  • First commit to issue fork.
  • πŸ‡©πŸ‡ͺGermany mhdev90 Apolda

    The problem is that the menu_item_extras module removes the "menu_link_content" bundle in the menu_link_content content type and creates a separate bundle for each menu.
    As a result, the field configuration has to be recreated (per bundle) and in addition, depending on the case, the form display may not be created/deleted.

    I have created an issue fork and a patch to handle the following issues:
    1. domain_menu_access is installed and menu_item_extras is being installed
    2. menu_item_extras is installed and domain_menu_access is being installed
    3. menu_item_extras and domain_menu_access are installed and domain_menu_access is being uninstalled

    The following problem is not yet addressed:
    menu_item_extras and domain_menu_access are installed and menu_item_extras is being uninstalled

  • Status changed to Needs work 2 days ago
  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    The patch looks promising! Thanks for being so supportive. But we should also cover the uninstall scenario.
    Maybe manual test can confirm what is needed?

Production build 0.69.0 2024