Found this thanks to #1985528: Convert filter_tips_long() to Controller, but it can occur in HEAD now.

I'll try to come up with a more tailored test, but this at least demonstrates the problem.

Steps to reproduce

  1. Install with Standard profile
  2. Login as user 1
  3. Go to admin/structure/views/view/pagenotfound

Expected result

404 Page not found

Actual result

200 WSOD

Essentially, any route with upcasting that fails will not get a 404 as expected.
This is in the dblog:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: in Drupal\Core\ParamConverter\ParamConverterManager->enhance() (line 83 of /Users/tim/www/d8/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php).
But you don't see an error and it doesn't 404.

Comments

tim.plunkett’s picture

Issue tags: +Stalking Crell
StatusFileSize
new1.78 KB

Okay, found the cause. It was my recent fix for _menu_translate().

Crell’s picture

+++ b/core/includes/menu.inc
@@ -771,7 +771,13 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) {
-    $request->attributes->add(Drupal::service('router')->matchRequest($request));
+    // Attempt to match this path to provide a fully built request to the
+    // acccess checker.
+    try {
+      $request->attributes->add(Drupal::service('router')->matchRequest($request));
+    }
+    catch (NotFoundHttpException $e) {
+    }
     $router_item['access'] = Drupal::service('access_manager')->check($route, $request);

If the request doesn't match, do we want to continue silently? Or wouldn't that mean that there's nothing there, so we always want to disallow access to the link? I'm not sure, since that would then imply links to broken pages simply never show up at all... Hm.

Either way, IF we keep the empty catch statement then it needs to be documented as to why it's empty.

tim.plunkett’s picture

StatusFileSize
new1.96 KB

Well if this passes, then we're better off doing it this way anyway.

tim.plunkett’s picture

This is a direct follow-up to #1938960: _menu_translate() doesn't care about new routes, it turns out. Sorry for the extra noise.

Crell’s picture

Status: Needs review » Reviewed & tested by the community

Since _menu_translate() is on the list of things to remove once the old routing system is removed, this seems fine to me.

dawehner’s picture

Crell’s picture

We don't have the Security component available, so no. :-)

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 081af87 and pused to 8.x. Thanks!

Took the liberty of organising the use statements in menu.inc as per standards...

Automatically closed -- issue fixed for 2 weeks with no activity.