Closed (fixed)
Project:
Page Manager
Version:
8.x-4.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 May 2023 at 03:03 UTC
Updated:
12 Aug 2024 at 07:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sorlov commentedGot the same issue on 9.5.9 as well
Comment #3
vacho commentedI found that this issue happens due to this change at the core: https://www.drupal.org/project/drupal/issues/3277784
Commit: https://git.drupalcode.org/project/drupal/-/commit/a894a04bac8f2cff2339b...
Comment #5
_renify_ commentedThankyou for suggestion @vacho but unfortunately it doesn't work to me.
Comment #6
vacho commentedPlease, review again if it was fixed for you, for my runs, also I am unsure if the test fails is related to this issue.
Comment #7
_renify_ commentedIt works for me. Thank you so much.
Comment #8
vacho commentedComment #9
vacho commented@_renify_ nice to know that works for you. I think should be set as "Fixed" when is merged. So for now is "Needs review" if you can review the code, and the testing issues that pipelines returns after this you can set as "Review and Tested by comunity"
Comment #10
_renify_ commentedComment #11
cilefen commentedIs this anything to do with #3364088: Ajax state leaking to Views destination paths?
Comment #12
bdh676 commentedI also ran into this issue updating from 9.3.5 -> 9.5.9. Also updated from PHP 7.4 -> 8.1
Comment #13
cilefen commentedRe: comment #2, the core issue to resolve the regression #3358402: [regression] route defaults are now automatically route parameters, I think
Comment #14
vacho commentedAbout comment #11
@cilefen No, that's about "Route defaults that do not start with a leading _" turn as query parameters, Also I tested on Drupal 10, 11 and the fix in this issue with page_manager still happens, and the MR fixes.
About comment #13
@cilefen , is related yes! but it is not a regression, I mean a core code doesn't turn back. #3358402 is to fix a title issue related as you can see at MR https://git.drupalcode.org/project/drupal/-/merge_requests/3953/diffs.
Comment #15
dabbor commentedHi @_renify_ and @vacho
I've reviewed and tested both
and they are basically the same and they both seem to work on the first look, but they cause problems with Page Manager pages to not work as expected and after debugging and looking into it I strongly believe (though I might be wrong as I do not understand the internals of Page Manager) that It is just breaking the
PageManagerRoutes::alterRoutes()method (defined in https://git.drupalcode.org/project/page_manager/-/blob/8.x-4.0-rc2/src/R... ) and thus:I would say it is quite obvious why as it changes the Route defaults name of the overridden route name from
overridden_route_nameto_overridden_route_nameon line$defaults['_overridden_route_name'] = $overridden_route_name;in https://git.drupalcode.org/project/page_manager/-/blob/8.x-4.0-rc2/src/R... but then it forgets to change the name when using it in VariantRouteFilter in 3 places:when calling the
$route->getDefault('overridden_route_name')The string
overridden_route_nameis not coming from Drupal Core so the only obvious origin of its definition is the Page Manager module itself. Meaning if the definition is changed fromoverridden_route_nameto_overridden_route_namethe usage of it later on should be as well.If I change it there to use
_overridden_route_namethe bad side effect I can observe is removed, but the intended fix is gone.I understand that you are using the
_(underscore) based on the commentin https://git.drupalcode.org/project/drupal/-/commit/a894a04bac8f2cff2339b... but when done properly, it doesn't seem to be fixing the issue here.
Comment #16
guptahemant commentedHere is a work in progress patch which tries to replace default by adding an underscore at the start but it is not complete since if we try to replace
page_manager_pagethen the page manager access starts failing.The reason for that failure is inside
PageAccessCheckthe routes defaults / parameters starting with underscore are not available.Not sure if this is the correct approach to resolve the issue, but posting it here in case if it helps to proceed with this issue further.
Comment #18
nginex commentedThis issue #3277784: copyRawVariables should support default route parameters changes a lot for the logic of this module.
So using default params that start with _ makes a lot of sense, although I had to rewrite logic for _page_access (route match does not fetch params that start with _ and are not a part of url).
The patch contains all the fixes including the tests update. Not sure how tests run if there are changes in the patch...
Comment #20
nginex commentedas I said, old tests performed, so it will be always failed
Comment #21
andypostIt will break all other contrib integration modules as it expect overrides without underscore
Comment #22
nginex commented@andypost good call, maybe we should try to fix it from drupal core side, let's say follow up issue of #3277784: copyRawVariables should support default route parameters
Comment #23
andypostyep, very probably at least for backward compatibility reason
Comment #24
vacho commentedThe thing is that the core change is already in the core! #3277784
I think we need to refactor this into page_manager core as is the proposal, also WIP solutions are welcome.
Comment #25
andypostComment #26
arijits.drushThere is a problem with #18 which is conflicting with pathauto here is how to reproduce it.
An error will prevent them to save that node saying
Need to check section
src/Entity/PageAccessCheck.phpComment #27
nginex commentedTODO:
Fix edge cases for PageAccessCheck.php
Comment #28
l_vandamme commentedI added some lines to the existing patch (the part of the access check) that load the page manager page entity if it is not loaded already. This seems to fix the access issues in our usecase (language switch links).
This does feel a lot like a bandaid for a bigger issue though, more investigation would be nice. Especially by someone more familiar with the routing system and the way parameters are being upcast to objects.
Comment #29
dabbor commentedI've tested the patch from #28 and reviewed it closely.
It is breaking page access for us on various pages and links (like breadcrumbs).
I agree with @L_VanDamme:
The
/page_manager/src/Routing/PageManagerRoutes.phpneeds more work and testing.I also doubt that the
page_manager_page.viewstring should be changed to version with underscore_page_manager_page.viewas it’s an access request and the change refers to something not existing.This is the line change I'm talking about
/page_manager/src/Routing/PageManagerRoutes.phpComment #30
daften commentedI've updated our bandaid with a fix that should hopefully fix the breadcrumb issues in general.
Comment #31
vacho commentedPatch #30 looks stable and I tested and works for my project. Please validate in deep
Also, please works over MR https://git.drupalcode.org/project/page_manager/-/merge_requests/13 to be able to take advantage of gitlab MR diffs and git log
Comment #32
vacho commentedAls needs works to fix testing https://www.drupal.org/pift-ci-job/2716580
Comment #33
sorlov commentedPatch is breaking access check for node path alias when trying to update existing node
Comment #34
niko- commented@sorlov
Possible fixed this error - need to check.
Comment #35
niko- commentedComment #38
niko- commentedFixed code_sniffers
Comment #39
niko- commentedComment #42
vasikeI think we could move to Needs review
Also added a child issue https://www.drupal.org/project/page_manager/issues/3373026
As it seems the MR solution solve it.
Comment #43
l_vandamme commentedI updated the MR to stop using RouteMatch parameters or request attributes as they are not reliable. Instead, we should use the Route defaults as we can be 100% sure they will be present and correct (as we set them ourselves).
This is needed because we have noticed very rare edge cases where the page entity could not be found in the RouteMatch parameters or request attributes. In our case this was most easily reproduced right after logging in with users that have a certain role. I did not debug what was actually causing this in code.
Comment #44
vacho commented- Code looks good.
- Testing locally, works!!
So RTBC
Comment #45
mkimmet commentedI'm seeing this problem as well. Any word on when this might be merged into a release? Thanks!
Comment #47
rowen92 commentedGreat work guys, seems to be working well, any thoughts when it will be merged?
Comment #48
liam morlandCurrent merge request as a patch.
Comment #49
vorona olya commentedComment #50
dqdThanks @ all working on this issue! +1
@#49 please edit your comment and put details and reasons on your additional patch.
@#48 thanks for providing a patch to the merge for others to better local testing on installed latest dev and better review. But just to let you know: you can simply add ".patch" on the end of the url of the latest merge while downloading to get a patch from latest merge.
First quick run thru patch review:
After applying the merge 13 from #46 cleanly wihtout flaws the following frontpage error occured on latest Drupal 10.2 stable release causing a WSOD:
After removing the applied patch and reverting to latest page_manager dev version, the site operates again.
Comment #51
dqdComment #52
liam morlandIf someone makes a commit to the issue fork, such a patch will change. That is no good for a Composer-based patching workflow.
Comment #53
dqdThanks for you rcoming back on this! +1
Yes, the number will change. So the merge 13 would change to merge 14 on the next one. But you can keep your path to the merge number 13 which will not change. Apart from that each merge would require then a new patch in the comments, which clutters the issue queue and would confuse users to keep uptodate on latest patch and reviews
Comment #54
liam morland@dqd I'm not sure I understand. Can you give an example of that URL that would be the equivalent of the patch in #48?
Comment #55
wadator commentedI have an issue with access conditions related to https://www.drupal.org/project/page_manager/issues/2837833. The issue appeared after update #43 update. Fixed on RouteMatch with a separate patch.
Comment #56
yurg commented#55 works for Drupal 10.2.6 / Page manager4.0@RC
Comment #58
vacho commentedmmm #48 say is a patch from MR, but it isn't https://www.drupal.org/project/page_manager/issues/3362561#comment-15339088
and now we have some enhacens from #48 that is out of current MR, needs to get compatible enhances into MR.
Comment #61
japerryPlease don't make patches as it makes things very confusing to review. I -think- the MR is the most updated, running tests now that head is passing on D9, 10, and 11. It'd be good if someone in this issue can also bring in the MR to verify it is working for them, or better yet, make a test that verifies what this is supposed to fix.
Comment #62
japerryTests are passing but would want some further validation on the MR before its merged.
Comment #64
japerryAfter doing some manual tests, it doesn't appear to be breaking things for me... so Fixed!
Comment #65
joseantonio7696Good, after trying to update my drupal version to the latest version available 10.3.1 and with php version 8.3. When I do the command composer update tells me that I can not apply the latest patch https://www.drupal.org/files/issues/2024-03-06/page_manager_path_query-3362561-55.patch. I leave attached a screenshot of it.
Has anyone had this happen recently?
Thank you very much.
Comment #66
nginex commented@Joseantonio7696
There is no need to apply outdated patch as this fix is already a part of the latest release 8.x-4.0-rc3