Problem/Motivation
After upgrading from taxonomy_menu 3.7 to 3.8 on Drupal 11.3.11 with Twig 3.27.x, taxonomy terms that are configured with a static plugin ID as their menu parent are placed at the root of the menu instead of under the configured parent.
Steps to reproduce
- Configure a taxonomy vocabulary with menu_parent set to a static menu link plugin ID. Example: a link defined in a custom module's
*.links.menu.yml. - Run on Drupal 11.3.11 with
taxonomy_menu8.x-3.8 - Clear caches
Expected behavior
Taxonomy terms appear as children of the configured parent menu link, at level:1 in the menu tree.
Actual behavior
Taxonomy terms appear at level:0 (menu root) as if no parent is configured. The menu_parent config value is correctly set (confirmed via drush config-get taxonomy_menu.taxonomy_menu.[vocabulary]) and the parent plugin exists and is accessible (confirmed via plugin.manager.menu.link->hasDefinition()).
Workaround
Pin taxonomy_menu to 8.x-3.7:
composer require 'drupal/taxonomy_menu:~3.7.0'
Environment
Drupal: 11.3.11
taxonomy_menu: 8.x-3.8 (broken), 8.x-3.7 (working)
Twig: 3.27.1
PHP: 8.3
Menu parent type: static plugin defined in *.links.menu.yml, not a menu_link_content entity
Additional notes
The parent plugin has an empty getDerivativeId() return value - it is not a derivative plugin. It is possible the 3.8 release changed how parent resolution handles non-derivative static plugins, causing the fallback to root level.
Comments