Problem/Motivation

Basically, it's a follow up for:
#2883680: Force all route filters and route enhancers to be non-lazy

We have made changes to routing filters and enhancers:

and made them non-lazy: #2883680-104: Force all route filters and route enhancers to be non-lazy

Since that we have to:

1. Update VariantRouteFilter to be implemented from Drupal's FilterInterface instead of Symfony's RouteFilterInterface.
see: \Drupal\Core\Routing\Enhancer\RouteEnhancerInterface | \Drupal\Core\Routing\RouteFilterInterface are removed

2. Update page_manager.services.yml to use the same approach like core.services.yml for page_manager.variant_route_filter service.

Proposed resolution

Fix that according to change records mentioned above.

Remaining tasks

1. Review this issue when #2915772: Deprecate non_lazy_route_enhancer service tag in favor of route_enhancer, same for non_lazy_route_filter and route_filter is done.
2. TBC

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alphawebgroup created an issue. See original summary.

alphawebgroup’s picture

Status: Needs review » Needs work

The last submitted patch, 2: page_manager_variant_route_filter-2918564.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

MaskOta’s picture

Assigned: alphawebgroup » Unassigned
Priority: Normal » Critical

Without this fix i was not able to install the module so i think this is critical.

The patch fixed it for me but i don't know what the consequences are.

alphawebgroup’s picture

there are no consequences
it just replaces one interface to other according to the description at the top of the issue
those fails in tests basically are not related to this patch I think (at least by a quick overview)

alphawebgroup’s picture

Status: Needs work » Needs review
alphawebgroup’s picture

Issue summary: View changes
alphawebgroup’s picture

Issue summary: View changes
alphawebgroup’s picture

Issue summary: View changes
alphawebgroup’s picture

Issue summary: View changes
Status: Needs review » Needs work
alphawebgroup’s picture

alphawebgroup’s picture

Title: Service 'page_manager.variant_route_filter' for consumer 'router.no_access_checks' does not implement Drupal\Core\Routing\FilterInterface » Update 'page_manager.variant_route_filter' service according to core changes
Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.76 KB

Status: Needs review » Needs work

The last submitted patch, 12: 2918564-12-update_variant_route_filter_service.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

alphawebgroup’s picture

Status: Needs work » Needs review
FileSize
7 KB

some tests have been fixed

Status: Needs review » Needs work

The last submitted patch, 14: 2918564-14-update_variant_route_filter_service.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

alphawebgroup’s picture

Status: Needs work » Needs review

it looks like tests are broken...
also, this one:

@trigger_error('\Drupal\Core\Routing\Enhancer\RouteEnhancerInterface is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Routing\EnhancerInterface. See https://www.drupal.org/node/2894934', E_USER_DEPRECATED);

in /web/core/lib/Drupal/Core/Routing/Enhancer/RouteEnhancerInterface.php will not allow make tests green as I understand
before we get fixed CTools' /web/modules/contrib/ctools/src/Routing/Enhancer/WizardEnhancer.php

alphawebgroup’s picture

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

This gets past the

exception 'Symfony\Component\DependencyInjection\Exception\LogicException' with message 'Service 'page_manager.variant_route_filter' for consumer [error]
'router.no_access_checks' does not implement Drupal\Core\Routing\FilterInterface.'

After upgrading to Drupal Core 8.5.x.

joelpittet’s picture

Status: Reviewed & tested by the community » Needs review

Actually, maybe needs to be tested with 8.4 first before RTBC.

dillix’s picture

+1 for RTBC, error has gone away after upgrade to 8.5.x

larowlan’s picture

8.5.0-alpha1 is out.

Queued test-runs for 8.4.x and 8.5.x - so we need to see if it passes on both branches, and then fix fails if not.

jibran’s picture

FileSize
679 bytes
7.05 KB

VariantRouteFilter was running before core route filters and giving me 405 instead of 404. Here is the fix.

Anybody’s picture

I can confirm that #22 fixes the problem with Drupal > 8.4.x while it breaks things for 8.4.x.

jonathan1055’s picture

Yes, the new interface:

-use Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface;
+use Drupal\Core\Routing\EnhancerInterface;

is only in core 8.5 and 8.6. It has not been backported to 8.4, but I have asked for this on #2924899: Backport \Routing\EnhancerInterface to core 8.4

Jonathan

alphawebgroup’s picture

@jibran thank you for your fix, I definitely missed that we need to fix page_manager.variant_route_filter service.

aleksip’s picture

Can also confirm that #22 works with 8.5.0-rc1.

dillix’s picture

8.5 was released today, so we need to fix this is issue

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

This fixed my install.

tucho’s picture

Hi!
I just tested the patch with the Drupal 8.5.0 release and it works ok.

hvanderheide’s picture

Ran into the same issue and the patch fixed it for me. For anyone who has to figure out how to patch the code (like me):
# cd modules/contrib/page_manager
# wget https://www.drupal.org/files/issues/2918564-22.patch
# patch -p 1 < 2918564-22.patch

Anybody’s picture

I can also confirm compatibility with 8.5.0

tim.plunkett’s picture

+++ b/src/Routing/RouteEnhancerCollectorTrait.php
@@ -7,24 +7,22 @@
- *
- * @todo Move to Symfony CMF in https://github.com/symfony-cmf/Routing/pull/155.

+++ b/src/Routing/VariantRouteFilter.php
@@ -1,17 +1,12 @@
-/**
- * @file
- * Contains \Drupal\page_manager\Routing\VariantRouteFilter.
- */
-

@@ -141,9 +136,9 @@ class VariantRouteFilter implements RouteFilterInterface {
-        // Restore the original request attributes, this must be done in the loop
-        // or the request attributes will not be calculated correctly for the
-        // next route.
+        // Restore the original request attributes, this must be done in
+        // the loop or the request attributes will not be calculated correctly
+        // for the next route.

Out of scope. Especially shouldn't remove the first hunk, since we need to use the new trait in Symfony CMF eventually.

If someone doesn't have time to revert those hunks, then I'll do it in a bit, before commit.

  • tim.plunkett committed 8ef4d16 on 8.x-4.x authored by jibran
    Issue #2918564 by alphawebgroup, jibran, tim.plunkett: Update '...
tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch! Committed.

karolus’s picture

Tested with 8.5.0 running PHP 7.0 and Panels Everywhere. With this patch to CTools, all running nominally, no issues found.

alphawebgroup’s picture

Thank you folks! It’s finally fixed!
Many thanks.

freelylw’s picture

I apply this patch on the latest dev version, I got the message:

Reversed (or previously applied) patch detected! Assume -R? [n]

Please advise what should I do ? Thank you.

dillix’s picture

@freelylw This patch was commited to the latest dev, why you try to patch it?

@tim.plunkett can you create new release according to #2952188: Beta 3 or new release?

freelylw’s picture

FileSize
18.21 KB

@dillix I am using the latest dev version, but I still getting problem which I am not quite sure where this problem come from. please see attached screen image.

After I go through the page making process. I end up on the page there is no where I can add things in, on a "path" showing, there is no context,content,general all those links that i can add things in.

Please advise if you know what's this problem. Thank you. I am in core8.5.0

dillix’s picture

@freelylw you should create new issue for this problem.

freelylw’s picture

I did https://www.drupal.org/project/page_manager/issues/2951961

But I guess this topic is related problem so I post it. if I am wrong sorry for this.

nico.pinos’s picture

My D8.5 site was unusable so I applied this patch and all my paths for my panel pages stopped working. They all give me a 404.
No error messages in the logs.

Are we sure this is not breaking things?

I will create another issue but I don't have much to work with since there are no errors in the logs.

Thanks!

xeM8VfDh’s picture

Erm... I tried updating my site from 8.4.5 to 8.5.0 and it failed with white screen of death everywhere and this stack trace:

[12-Mar-2018 20:58:34 UTC] Symfony\Component\DependencyInjection\Exception\LogicException: Service 'page_manager.variant_route_filter' for consumer 'router.no_access_checks' does not implement Drupal\Core\Routing\FilterInterface. in /srv/bindings/****/code/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php on line 164 #0 /srv/bindings/****/code/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php(97): Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->processServiceCollectorPass(Array, 'router.no_acces...', Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#1 /srv/bindings/****/code/vendor/symfony/dependency-injection/Compiler/Compiler.php(141): Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->process(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#2 /srv/bindings/****/code/vendor/symfony/dependency-injection/ContainerBuilder.php(757): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#3 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(1307): Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#4 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(884): Drupal\Core\DrupalKernel->compileContainer()
#5 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(466): Drupal\Core\DrupalKernel->initializeContainer()
#6 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(656): Drupal\Core\DrupalKernel->boot()
#7 /srv/bindings/****/code/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#8 {main}

[12-Mar-2018 20:59:10 UTC] Symfony\Component\DependencyInjection\Exception\LogicException: Service 'page_manager.variant_route_filter' for consumer 'router.no_access_checks' does not implement Drupal\Core\Routing\FilterInterface. in /srv/bindings/****/code/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php on line 164 #0 /srv/bindings/****/code/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php(97): Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->processServiceCollectorPass(Array, 'router.no_acces...', Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#1 /srv/bindings/****/code/vendor/symfony/dependency-injection/Compiler/Compiler.php(141): Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->process(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#2 /srv/bindings/****/code/vendor/symfony/dependency-injection/ContainerBuilder.php(757): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#3 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(1307): Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#4 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(884): Drupal\Core\DrupalKernel->compileContainer()
#5 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(466): Drupal\Core\DrupalKernel->initializeContainer()
#6 /srv/bindings/****/code/core/lib/Drupal/Core/DrupalKernel.php(656): Drupal\Core\DrupalKernel->boot()
#7 /srv/bindings/****/code/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#8 {main}
xeM8VfDh’s picture

@joelpittet, are you suggesting in #18 that those of us on 8.4.x need to update to 8.5.0 (this broke my site), then manually install that the patch you referenced? If that is the case, do we think this fix will be rolled into a new Page Manager release soon(ish)? If so, would we need to update Page Manager before updating core to 8.5.x? Thanks in advance, much appreciated.

dillix’s picture

@xeM8VfDh patch was commited to the latest dev!!!

kadsy’s picture

i can confirm #39 happen to me too. D8.50 with this module latest dev.
there is no error in Log messages tho.

tim.plunkett’s picture

Can #39 be opened as a new issue? I think that's also a bug, but is not directly tied to this issue.

freelylw’s picture

xeM8VfDh’s picture

what about #42, has anyone else experienced the same issue?

@dillix thanks for the clarification. For those of us running 8.x-4.0-beta2 instead of the dev branch, do you think there is any projected time-line for this fix being pushed out into a more official release than the dev branch? I would think it would warrant a new beta, since this is a rather popular module and this fix is a requirement for the module to work with the current version of D8 (8.5.0). Thoughts?

tim.plunkett’s picture

Thanks @freelylw

@xeM8VfDh This issue has been fixed. Other problems should each have their own issue.

nico.pinos’s picture

Was anyone able to reproduce #42?

I'm talking about panel pages built with page manager using custom blocks.

I'm trying to make sure this is not an issue caused by something else on my installation.

tim.plunkett’s picture

Status: Fixed » Closed (fixed)

Please open an issue describing the bug in #42.

xeM8VfDh’s picture

@tim.plunkett, is our only option to deploy the patch or install the dev branch instead of the latest beta branch? Or will a new beta branch be issued for this, seeing as this fix is required for 8.5.0+ compatibility, so anyone creating a new D8 site who also wants to use this rather popular module will have to use the dev branch of PM instead of the "official" beta release?

mpotter’s picture

@nico.pinos did you create the issue for #42? After updating to page_manager 4.x-dev and core 8.5.x all of my pages are giving 404 errors also.

Edited: My guess is that the problem is there has been some config changes between the Beta2 and the Dev version without any update hooks. So doing the config-import after updating to page_manager dev and core 8.5 apparently causes broken pages. I'm going to try going back to the beta with the above patch to see if that works better.

Perhaps that is why there isn't a new Beta release yet since there would need to be update hooks to migrate any config changes.

mpotter’s picture

Also, problem is that #22 doesn't actually apply to 4.0-beta2

Edited: Ahh, the problem was that the patch in #22 isn't compatible with the patch in #2876880: page_variant entity type does not exist when installing or enabling. Trying #22 by itself now.

mpotter’s picture

All pages still giving 404 as in #42 even going back to the Beta2 with the patch in #22. So not a config change. Something incompatible with core 8.5. Posted new issue here: #2953056: Update to core 8.5.x breaks all page_manager pages

brunodbo’s picture

@mpotter: Do you have Rules installed on your site? If so, the 404 issue might be related to #2951263: With Rules enabled, page_manager pages return a 404 after core 8.5 update.

xeM8VfDh’s picture

@mpotter, thanks for the info. You raise a good point. Since the beta2 release is nearly a year old, and since there is apparently a fix (#22) for this issue, and since said fix is a requirement for current versions of drupal, I think the circumstances warrant drafting a new beta release that include the config migration hooks @mpotter mentioned. That is, assuming #22 is a stable fix, which it sounds like it might not be given #42 and #56

I suppose this issue covers this topic.

mxh’s picture

I have the problem that my taxonomy routes are broken. Even the edit form now only returns entity.taxonomy_term.canonical as route.

tim.plunkett’s picture

Each new problem that has been described (#39, #42, #59) are all related to 8.5.0, but unrelated to this particular bug.
Some have new issues (see #56, #57), others should be opened for them.