Menu link content module stores the reference of deleted links

Created on 5 February 2019, almost 6 years ago
Updated 7 July 2023, over 1 year ago

We have encountered quite a few incidents where deleted menu link were throwing fatal errors on our websites (The website encountered an unexpected error. Please try again later.Drupal\Core\Entity\EntityStorageException: Query condition 'menu_link_content.uuid IN ()' cannot be empty.) as described below :

  • In the first incident, we were getting this error while accessing a particular menu. I explained the issue in detail in an existing issue https://www.drupal.org/project/drupal/issues/2790121 (Please read #15)
  • In the second incident we're seeing this same error while trying to delete a node. During troubleshooting it turned out that the menu_link_content_entity_predelete (defined menu_link_content.module file) function tries to retrieve the list of menu links connected to the node we’re trying to delete, there’s a menu link in the $result variable, which doesn't exist anymore. It then tries to delete that link and is not able to find it’s uuid and hence through the exception. plugin.manager.menu.link seems to be the culprit here.

In both the cases this module is looking for uuid of a menu link that was deleted, but looks like it's reference remains in the system somewhere.

🐛 Bug report
Status

Closed: cannot reproduce

Version

9.5

Component
Menu link content 

Last updated 6 days ago

Created by

🇨🇦Canada navinder

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.

  • 🇦🇺Australia darvanen Sydney, Australia

    Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" 13 months ago.

    Like @quietone, I also was unable to reproduce the issue. I tested with the version of core from when this issue was filed with the following steps:

    1. Create some content with a menu link (Check Provide a menu link)
    2. Create a menu block that contains that menu items (check the expand-option) and display the block on a (content-)page
    3. Remove a previously created menu link at one if the nodes
    4. Visit the previously created page and get the exception

    Since neither I nor @quietone could reproduce this issue and since there weren't other steps to reproduce the issue provided since the issue was postponed in February 2019, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".

    Thanks!

Production build 0.71.5 2024