Follow-up from #2047633-296: Move definition of menu links to hook_menu_link_defaults(), decouple key name from path, and make 'parent' explicit.

Updated: Comment #0

Problem/Motivation

Steps to reproduce:

  1. install the 'Testing' module
  2. the link to 'Testing' appears in the 'Development' section at admin/config
  3. uninstall the 'Testing' module
  4. the link to 'Testing' still appears in admin/config
  5. clicking on the link you get an exception Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "\drupal\simpletest\form\simpletesttestform"

Proposed resolution

Remaining tasks

User interface changes

API changes

Comments

mondrake’s picture

Not sure about priority nor whether there are other issues for this.

mondrake’s picture

Category: Task » Bug report
Status: Needs review » Active
sidharthap’s picture

I tried it for contact module and the result is same. The path remains inside the menu_link table after the module uninstall.

internetdevels’s picture

Status: Active » Needs review
StatusFileSize
new1.8 KB

This patch should fix the problem.

berdir’s picture

We're not removing routers, we're removing routes. The router is the thing that routes a route :)

Also, this issue is about menu links, not routes, so not sure how this is related?

sidharthap’s picture

A new patch to remove menu links.

dawehner’s picture

catch’s picture

Status: Needs review » Postponed

Postponing on that issue, we can re-test this after that's in. Or if that issue is adding test coverage just mark duplicate.

mondrake’s picture

mondrake’s picture

Added related.

mondrake’s picture

Status: Postponed » Active

OK, so #2177041: Remove all implementations of hook_menu has solved the OP, i.e. the menu link is removed. However, the route seems to be still resolved as by calling the route path from the browser directly I still get the exception:

  1. install the 'Testing' module
  2. the link to 'Testing' appears in the 'Development' section at admin/config
  3. uninstall the 'Testing' module
  4. the link to 'Testing' no longer appears in admin/config
  5. typing directly http://{mysite}/admin/config/development/testing in the browser address box you get an exception Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "\drupal\simpletest\form\simpletesttestform"

I suppose #2200185: Router table is not cleared when modules are uninstalled would cover that?

Setting to active for verification, feel free to set to duplicate as the OP is actually fixed.

catch’s picture

Status: Active » Closed (duplicate)

I bumped the other issue to critical, marking this as duplicate for now.