Handle DB table 'menu_tree' when trashing menu links

Created on 16 July 2025, about 1 month ago

Problem/Motivation

Custom menu links are stored in 2 primary places: the main entity tables and also in the 'menu_tree' DB table. The latter is ignored by trash currently, and this is causing problems. For example, when soft-deleting a menu link, and then trying to read the link in an 'ignore' context, exceptions are thrown because MenuTreeStorage doesn't find the link in the menu_tree table.

Steps to reproduce

  1. ddev drush si standard -y && ddev drush en -y trash wse_menu && ddev drush uli
  2. Go to /admin/config/content/trash and enable trash for menu links
  3. Go to /admin/structure/menu/manage/main
  4. Add a new link with path /test
  5. Trash the link
  6. Go to /admin/config/workflow/workspaces
  7. Create a new ws
  8. Inside of it create a node with alias /test
  9. Publish the workspace
  10. Try to deleted the workspace you just published
  11. Notice the exception

Proposed resolution

Trash should handle MenuTreeStorage operations.

Remaining tasks

Open a PR

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇸🇮Slovenia alecsmrekar

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

Comments & Activities

Production build 0.71.5 2024