This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Fix: incorrect default number of products in editor when inheriting query #10303
Merged
+66
−7
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
deab066
fix: post per page in editor for the Products Beta block
dinhtungdu adc7297
fix: post per page in editor for the Product Collection block
dinhtungdu 0d8fc18
fix: setting the correct attribute after inserting block to archive t…
dinhtungdu 1b58ef0
update block template
dinhtungdu d924b1e
revert changes made to Product Query
dinhtungdu de8a58a
avoid white space diff
dinhtungdu c338aa2
fix: post per page in the editor for product query block
dinhtungdu 8031b36
Merge branch 'trunk' into fix/10228-cleaner-approach
dinhtungdu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
AFAIK, we should use
inherit
instead of__woocommerceInherit
. The__woocommerceInherit
is added only whenisCustomInheritGlobalQueryImplementationEnabled
is true, but we've decided not to implement the custom inherit query from template. Therefore, this flag will always be false, as seen here. You can also find related discussion on Slack here: p1681812585287949-slack-C02UBB1EPEF.In short, we shouldn’t use
__woocommerceInherit
. Additionally, I believe we can remove theisCustomInheritGlobalQueryImplementationEnabled
flag and related code since we decided not to implement the "custom inherit query from template." I understand it might be confusing because there is still a partial implementation for the "custom inherit query from template," which is disabled by using theisCustomInheritGlobalQueryImplementationEnabled
flag.Does that make sense?
CC: @gigitux
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.
Since the logic is added on the Products block (that will be deprecated) I agree with you, we can remove that logic!
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.
Thanks @imanish003 for the review, I agree this is a bit confusing, so let's discuss more.
__woocommerceInherit
attribute just for detecting if the current rest query is inherited from template. I used it in therest_product_query
filter here (as a custom rest query argument). The reason for that is I can't find a better way, I'm open to any alternative that we can detect the 'inherit state' in the rest query. I admit this is a workaround than a solution, but given that theProducts (Beta)
block will be deprecated, this is acceptable IMO.isCustomInheritGlobalQueryImplementationEnabled
, let's do it in a separated PR for better history.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.
Not sure why but it's still showing 9 products in Products beta block 🤔 Are you able to replicate this?
Got it. In that case, maybe we should consider naming this something other than __woocommerceInherit because its original intention was for use in the "custom inherit from query" implementation. Since this fix is not directly related to "custom inherit from query," using __woocommerceInherit for this fix might cause confusion. What do you think?
Definitely, Also this doesn't fall into scope of this PR.
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.
@imanish003 Because we're removing that "custom inherit feature", and the Products (Beta) block will be deprecated eventually, I don't think that's a big issue. But by the way, any name will work, I will try to find another one to clear any potential confusion.
Let's pair on this.
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.
Thank you so much for your understanding. Since we're unsure who will be working on removing the "custom inherit query" feature, it's better to avoid any potential confusion if we can. 🙌🏻