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).

Comments

pravat231 created an issue. See original summary.

abhaypai’s picture

Priority: Critical » Normal
Status: Needs work » Postponed

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.

abhaypai’s picture

Status: Postponed » Needs work
Issue tags: +Needs steps to reproduce

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

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.