Issue while using hook_menu_links_discovered_alter which is throwing error

Created on 14 July 2023, 12 months ago
Updated 13 December 2023, 7 months ago

I am using this hook "hook_menu_links_discovered_alter" in my module file to add links to my existing custom menu. The feature is working fine but the issue starts coming if I will change these menu ordering or do any modification manually through admin panel. And after these modification, If I am uninstalling my module and then after that opening my custom menu through browser its throws below error. And even after clearing cache the error is not stopping. The only solution to this problem, I found is again install the old module and do the reset of these menu's and after that uninstall the module which would solve the issue.

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "my_module.links_custom_menu" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of /web/core/lib/Drupal/Core/Routing/RouteProvider.php).

🐛 Bug report
Status

Needs work

Version

10.1

Component
Menu system 

Last updated 4 days ago

Created by

🇮🇳India pravat231

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

Comments & Activities

  • Issue created by @pravat231
  • Status changed to Postponed 7 months ago
  • 🇵🇭Philippines abhaypai

    Thanks for reporting.

    Will need steps to reproduce.

    Also changing the priority to Normal and status to Postponed until reporter adds more information in the issue.

  • Status changed to Needs work 7 months ago
  • 🇵🇭Philippines abhaypai

    Updating the status to Needs work, i guess postponed was incorrect to select.

Production build 0.69.0 2024