-
Notifications
You must be signed in to change notification settings - Fork 34
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
PLANET-7657: Add support for TA pages #2492
base: main
Are you sure you want to change the base?
PLANET-7657: Add support for TA pages #2492
Conversation
/unhold a975c379-d207-4f97-ad06-c8f706f2396f
Test instance is ready 🚀🌑 pandora | admin | blocks report | CircleCI | composer-local.json ⌚ 2025.01.09 20:07:44 |
Ref: https://jira.greenpeace.org/browse/PLANET-7657 - Partial changes
- Rollback code
f920545
to
e453553
Compare
/unhold 50f41f82-232f-4ceb-860f-0f16e2dc2acc
e453553
to
40999b8
Compare
/unhold b5d2ff18-b0dd-4bfb-97d7-627deda67876
- Sanitize query params
40999b8
to
5156bd0
Compare
/unhold 7a30da37-8206-4cf9-8f18-6edfefd710d0
@@ -43,13 +43,26 @@ public static function registerFrontendQuery(): void | |||
'query_loop_block_query_vars', | |||
function ($query, $block) { | |||
$blockQuery = $block->context['query'] ?? []; | |||
|
|||
// Sanitize query only applied to ActionsList block. | |||
if ((bool) array_key_exists('isCustomQueryLoop', $blockQuery)) { |
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.
Need to check this to avoid apply this changes to the native core/query
query.
const IS_NEW_IA = window.p4_vars.options.new_ia; | ||
const queryPostType = IS_NEW_IA ? 'p4_action' : 'page'; | ||
|
||
if(query.postType !== queryPostType) { |
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.
Need to implement this since the query passed through attributes (1) it's not the same as the one needed by the query loop (2)
For instance:
(1)
{
"post_type":"page",
"order":"DESC",
"orderby":"date",
"post__not_in":[
2067
],
"tax_query":[
],
"offset":0,
"posts_per_page":3,
"author__in":[]
}
(2)
{
"pages":0,
"perPage":3,
"offset":0,
"order":"desc",
"orderBy":"date",
"postStatus":"publish",
"author":"",
"search":"",
"exclude":[
2067
],
"sticky":"",
"inherit":false,
"postType":"page",
"postIn":[
],
"hasPassword":false,
"parent":9,
"post_parent":9
}
Summary
The ActionsList block might render the same content as the Covers block.
Ref: https://jira.greenpeace.org/browse/PLANET-7657
Testing
Then check: