I found a neat way to disable a whole section of my site with 500 errors.

Steps to reproduce:

1. Create a basic page, "Foobar".
2. Give it a path of /foobar.
3. Give it a menu item.
3. Create a context triggered by /foobar and /foo/*
4. Add the active trail reaction for the menu item you just created.
5. Delete the page.
6. Create a new basic page with the same path.
7. Visit it. Your PHP log will be full of this: Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "Plugin ID 'menu_link_content:4d6a0c38-b009-43fb-bd06-fad06f25d643' was not found."

Expected behavior: no error, the active trail just shouldn't work anymore on the new /foobar page.

Comments

CatherineOmega created an issue. See original summary.

drclaw’s picture

Version: 8.x-1.0-rc1 » 8.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new878 bytes

Here's a patch that catches the missing plugin error and uses the Drupal logger to log the error instead. There may be a more graceful way to do this but for now it at least takes care of the whitescreen :)

jurgenhaas’s picture

Status: Needs review » Reviewed & tested by the community

This is awesome. We ran into this same issue last night on a production site and it caused us a sleepless night until we found this report and patch. Thanks @drclaw, this is working just fine.

  • jigarius committed c385818 on 8.x-1.x
    Issue #2896272 by drclaw: Deleting a node related to a menu link causes...
jigarius’s picture

Status: Reviewed & tested by the community » Fixed

This has been fixed in dev and will be included in the next release.

jigarius’s picture

Status: Fixed » Closed (fixed)