- 🇫🇷France goz
I have the same issue. Here is my way to reproduce.
1/ Create a term in a vocabulary synced with menu.
2/ Set term as enabled.
3/ Menu item is created and enabled.
4/ Disable term
5/ Menu item is still enabledThere is two issues in code :
1/ In TaxonomyMenu::buildDefinition(), menu link should take care of term status.// There is no enabled key here. $link += [ 'id' => $this->buildMenuPluginId($term), 'title' => $term->label(), 'description' => $term->getDescription(), 'menu_name' => $menu_id, 'expanded' => $this->expanded, 'metadata' => [ 'taxonomy_menu_id' => $taxonomy_menu_id, 'taxonomy_term_id' => $term_id, ], 'route_name' => $term_url->getRouteName(), 'route_parameters' => $term_url->getRouteParameters(), 'load arguments' => $arguments, 'parent' => $menu_parent_id, 'provider' => 'taxonomy_menu', 'class' => 'Drupal\taxonomy_menu\Plugin\Menu\TaxonomyMenuMenuLink', ];
2/ In update, TaxonomyMenuMenuLink::updateLink(), is called with $persist at false. When term is updated, some updates are passed to menu link like title or weight changes, but not status.
I'll make a MR to make menu link follow term status changes.
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Not currently mergeable. - @goz opened merge request.
- last update
over 1 year ago 4 pass - Status changed to Needs review
over 1 year ago 8:05am 1 June 2023