-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-2839: Fix pagination with ez_render_content_query() #303
base: 1.3
Are you sure you want to change the base?
IBX-2839: Fix pagination with ez_render_content_query() #303
Conversation
Still WIP as I haven't added any tests yet. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
return new ControllerReference('ez_query_render::renderQuery', [ | ||
'options' => $options, | ||
]); | ||
$pageParam = isset($options['pagination']['page_param']) ? $options['pagination']['page_param'] : 'page'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI : The default value for page_param
is also hardcoded here : https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.17/eZ/Publish/Core/MVC/Symfony/Controller/QueryRenderController.php#L76-L81
+1 but please adapt failing unit tests |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Existing tests fixed and added one more |
eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php
Outdated
Show resolved
Hide resolved
Hey @vidarl this looks like almost ready. Any progress on applying the requested change. Or is this outdated/not relevant anymore? |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
It is still relevant. Suggestions are now implemented |
…deringExtension.php Co-authored-by: Andrew Longosz <[email protected]>
5809cfd
to
ef2ae98
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@alongosz : I have now also rebased the PR to latest 2.3. Anything else that needs to be done in order to get approval ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look okay but when relying on RequestStack and current request I always have concerns how it's going to work inside render_esi
fragments and Varnish. Have you checked this case?
@@ -0,0 +1,48 @@ | |||
--TEST-- | |||
"ez_render_content_query_b" function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean ez_render_content_query
?
v3.3
The problem is that setting the page_param parameter in a template won't work:
Specifying a GET parameter named current_page won't affect the query result :
http://localhost:8080/tests/cs-9997-querytype-and-limit?current_page=2
This is because the twig function will issue a subrequest and the GET variable specified by the
page_param
parameter won't be passed on to the subrequest :https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.17/eZ/Publish/Core/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php#L37-L39
In this PR I just pass on the
page_param
to the subrequestChecklist:
$ composer fix-cs
).@ezsystems/engineering-team
).