I have a content type called Sprint, and wanted to customize its layout, so I added a new variant if type Panel in the node_view page with the condition being type: sprint. The layout works fine for all the Sprint pages, but when I navigate to any other node/{node} page of other content type, I get an internal server error.
Log messages give this:

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: No route found for "GET /node/251": Method Not Allowed (Allow: DELETE, PATCH) in Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest() (line 180 of /data/disk/o5013607723/static/newborn_1.0b10/vendor/symfony/http-kernel/EventListener/RouterListener.php).

Is anyone else facing an issue like this?

CommentFileSizeAuthor
#5 page_variant_for_node-2782661-5.patch1.53 KBsylus
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RawanMoukalled created an issue. See original summary.

snehi’s picture

yes facing the same issue.

yesnoio’s picture

I too seem to be having the same problem. The PageManagerRoutes::alterRoutes method loops through all page entity types, removing the route to each page entity if a matching route exists. Before removing a matching route, information is gathered about the route.
The method then builds a new route for each variation of the page entity type, adding the new route back into the collection of routes associated with the current RouteBuildEvent instance.
The building of the new route seems to be where the issue is. Digging deeper. Thoughts?
When attempting to set the site default page to something like node/407, Drupal responds with The path '/node/407' is either invalid or you do not have access to it. Pages, such as node/add, result in a MethodNotAllowedException & a 404 response.

drupal 8.1.9
page_manager 8.x-1.0-alpha24
ctools 8.x-3.0-alpha27

sylus’s picture

Am also having this problem as well with the exact same reproduction. Also affects the "node.add_page" route.

sylus’s picture

Here is an initial hack that exempts the routes that are still accessible as a temporary workaround.

mkostrzewa’s picture

Hi Sylus,

I assume that patch worked for you. I seem to be getting a similar issue, where I get 'You are not authorized to access this page"

tim.plunkett’s picture

This should be handled by #2736385: Page Manager routing is overly complex and brittle: breaks REST, active trail, fallback pages now. Not closing this yet, but please try that patch out.

tim.plunkett’s picture

Status: Fixed » Closed (fixed)

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