diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 98bcdbd..ce71f71 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -964,9 +964,6 @@ function _menu_link_translate(&$item, $translate = FALSE) { * @return bool * TRUE if the user has access or FALSE if the user should be presented * with access denied. - * - * @throws \Symfony\Component\Routing\Exception\ResourceNotFoundException - * If the system path in $href does not match the $route. */ function menu_item_route_access(Route $route, $href, &$map) { $request = RequestHelper::duplicate(\Drupal::request(), '/' . $href); diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php index 060303a..3f3a1d8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php @@ -37,17 +37,10 @@ public function testPermissionAccess() { $path = 'router_test/test7'; $this->drupalGet($path); $this->assertResponse(403, "Access denied for a route where we don't have a permission"); - // An invalid path should throw an exception. + $map = array(); $route = \Drupal::service('router.route_provider')->getRouteByName('router_test.7'); - try { - menu_item_route_access($route, $path . 'invalid', $map); - $exception = FALSE; - } - catch (ResourceNotFoundException $e) { - $exception = TRUE; - } - $this->assertTrue($exception, 'A ResourceNotFoundException was thrown while checking access for an invalid route.'); + $this->assertFalse(menu_item_route_access($route, $path . 'invalid', $map)); $this->drupalGet('router_test/test8'); $this->assertResponse(403, 'Access denied by default if no access specified');