When Rules is enabled on a 8.5 site, custom pages created with page_manager return a 404 response. If you uninstall Rules, the same page_manager page returns a normal (200) response. This is running both the latest Rules and page_manager dev releases.

Original summary: (posted in the page_manager queue)

i see the pages are still there and configured so the data is not gone. i tried disable and enable but still, any page handled by page manager now says page not found 404.

CommentFileSizeAuthor
#13 2951263-rules-13.patch1.57 KBtim.plunkett
#12 2951263-12.patch696 bytesmpotter

Comments

drupalstrap created an issue. See original summary.

brunodbo’s picture

Title: page not found for page manager pages after core 8.5 update » 'Page not found' for page_manager pages after core 8.5 update
Priority: Normal » Major

Same issue here with a standalone page (so not overriding e.g., the node page).

Watchdog has this:

Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/test". in Drupal\Core\Routing\Router->matchRequest() (line 125 of /home/bruno/workspace/tx8/drupal_composer/web/core/lib/Drupal/Core/Routing/Router.php).

When I look at the devel routes list (/devel/routes), I can see the route name listed for my path, but when I click the 'Devel' button next to that, I get the warning message that it's Unable to load route for url '/test'.

brunodbo’s picture

Priority: Major » Normal

Looks like this might be coming from Rules (https://www.drupal.org/project/rules/): if I disable Rules on my site, page_manager pages load fine.

@drupalstrap: Do you have Rules installed on your site? Can you see if uninstalling it makes a difference?

pyxio’s picture

yes i confirm uninstalling rules brings the pages back.

eclipsegc’s picture

Ok, so do we want to move this to the rules issue queue then? Does simply having rules enabled cause the issue? or do particular setups cause the problem in the events/conditions/actions of a particular rule?

Eclipse

brunodbo’s picture

Title: 'Page not found' for page_manager pages after core 8.5 update » With Rules enabled, page_manager pages return a 404 after core 8.5 update
Project: Page Manager » Rules
Version: 8.x-4.0-beta2 » 8.x-3.x-dev
Component: Miscellaneous » Rules Core
Issue summary: View changes

Yep, I was going to move it but didn't get around to it earlier. Updating the summary as well.

For me, it was simply having Rules enabled that caused page_manager pages to return a 404. I didn't have any rules configured on my site yet.

brunodbo’s picture

Issue summary: View changes
eclipsegc’s picture

So page_manager defines its routes via a subscription to the RoutingEvents::ALTER event. Rules is also using this event. I looked at it and saw nothing that gave me pause, but we might try turning it off anyway just to see if it solves the issue.

Eclipse

mpotter’s picture

Confirm that this is happening on my client site also. Rules + Page_Manager gives "Page not found" on pages...uninstalling Rules restores functionality. This is even using the page_manager 4.0-beta2+patch for core 8.5.

Unfortunately this site needs both Rules and Page Manager, so I need to big into this more. Thanks for the info on the RoutingEvents::Alter...I'll start looking there.

mpotter’s picture

Not sure the RoutingEvents::Alter is the cause. I commented out the code in that class in Rules and still had the problem when Rules was enabled. Digging more.

mpotter’s picture

Ran through xdebug and looks like the rules.ui_route_enhancer is giving an exception "The "" plugin does not exist." when called by VariantRouteFilter::getRequestAttributes(). This causes it to return False so getVariantRouteName() doesn't return the page_manager route name. Looking more into a fix.

mpotter’s picture

Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new696 bytes

The problem is that rules is assuming that every route has a "_rules_ui" option entry that specifies a Rules plugin. Definitely a problem with Rules and not Page Manager. Not exactly sure why this just happens now in Drupal 8.5, but it's clearly a bug. Here is a patch that ensures it doesn't try to load an invalid plugin_id.

Marking this as Major since this could affect any other module that calls the route enhancer and not just page_manager.

tim.plunkett’s picture

StatusFileSize
new1.57 KB

#2953397: Provide BC layer for RouteEnhancerInterface will fix this by providing a BC layer for #2883680: Force all route filters and route enhancers to be non-lazy
Here's a fix to stop using the deprecated approach

tim.plunkett’s picture

Slight crosspost there. The patches do roughly the same thing.

superlolo95’s picture

patch worked for me
thanks

pbosmans’s picture

Thank you. Patch #13 worked for me.

guillaumeduveau’s picture

Patch #13 works for me too.

tim.plunkett’s picture

The BC layer was added to Page Manager. But this should also be committed.
Can someone mark this RTBC?

abramm’s picture

Status: Needs review » Reviewed & tested by the community

The patch #13 works just fine for me.

RTBC.

tr’s picture

  • fago committed d67f785 on 8.x-3.x authored by tim.plunkett
    Issue #2951263 by mpotter, tim.plunkett: With Rules enabled,...
fago’s picture

Status: Reviewed & tested by the community » Fixed

thx, committed.

Status: Fixed » Closed (fixed)

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