-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Query Loop: Disallow "enhanced pagination" with core blocks that may contain third-party blocks #55539
Query Loop: Disallow "enhanced pagination" with core blocks that may contain third-party blocks #55539
Conversation
Size Change: -805 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
I feel that maybe the term "plugin blocks" can be misunderstood. Someone could consider blocks from the Gutenberg plugin as "plugin blocks", whereas it refers to blocks from other third-party plugins. 🤔 |
Flaky tests detected in 5725905. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6624878861
|
I have updated the texts, although I'm not 100% convinced of the outcome. 🤔 |
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.
Great work, David 🙂
I think we can merge this as it is and if we need to, improve the styles of the list of blocks later.
Suddenly, today in my local environment I got this change and could not test Enhanced pagination with Twenty Twenty-Four any longer. I'm not sure I fully understand the rational behind this change but that's not the point I guess. My point is that a bundled theme like Twenty Twenty-Four should be compatible with all the editor features. This change makes Twenty Twenty-Four not compatible with Enhanced pagination. And yes, Twenty Twenty-Four does have a 'Post Meta' block inside the Query loop, see screenshot. However, this PR description only mentions:
I would also like to point out that relevant changes like this one should be accompanied by a related GitHub issue to clearly explain what the problem is also to the non-initiated. A pull request without an accompanying issue does not guarantee a sufficient discoverability of this change. In an open source project, issues and pull requests represent also the history of the project and should be easiliy findable and understandable by anyone, at any time. I wiould like to see this change carefully evaluated in the context of the Twenty Twenty-Four theme which is going to be released together with WordPress 6.4 in less than two weeks. Cc @carolinan as you have more in depth knowledge of Twenty Twenty-Four. |
I am missing context about why third party blocks are not allowed with this pagination. The why section does not explain why this is a problem. Many block themes will want to to use template part or patterns inside a query, because this helps developers reduce code duplication, and I may even say it is best practice. Patterns is also the only way to add translatable strings. Secondly and yes this is opinionated :) but a much less intrusive way to disable the pagination, would be to simply hide it without any message. This message encourages people to remove patterns which does not contain anything harmful. (And I mean hide it completely, not display it as disabled) |
This is absolutely true. It would be a shame not to be able to activate the enhanced pagination in the Twenty Twenty-Four theme. Thanks for the heads up, @afercia and @carolinan 🙏 The good news is that it's not because it doesn't work, but because we were being very cautious in detecting unsupported blocks. But I've been talking with @DAreRodz and we have an idea to improve how we detect unsupported blocks that will solve this problem for TT4. We're going to be working on it now to have the fix ready today, and I will add more in-depth explanations about why the enhanced pagination doesn't support all blocks yet and what our plans are to improve that in the future. |
…contain third-party blocks (#55539) * Update useContainsThirdPartyBlocks and texts * Improve texts a bit * Show the list of unsupported blocks * Use the BlockTitle component instead * Simplify modal text
Cherry-picked for inclusion in 6.4 in f2dd6de. |
Sorry for the confusion. I didn't explain myself well in Slack. This should be included in 6.4. It's the subsequent fix to make the enhanced pagination work in TT4 the one I think we could do in 6.4.1. I've provided a longer explanation in the Slack thread. |
…contain third-party blocks (#55539) * Update useContainsThirdPartyBlocks and texts * Improve texts a bit * Show the list of unsupported blocks * Use the BlockTitle component instead * Simplify modal text
Thank you again for the clarification! Following the linked discussion, the change has been cherry-picked for inclusion in 6.4 in 87e68c6. |
* Patterns: set context of pattern category api call to view so authors and contributors can access (#55553) * Query Loop: Disallow "enhanced pagination" with core blocks that may contain third-party blocks (#55539) * Update useContainsThirdPartyBlocks and texts * Improve texts a bit * Show the list of unsupported blocks * Use the BlockTitle component instead * Simplify modal text * Revert "Query Loop: Disallow "enhanced pagination" with core blocks that may contain third-party blocks (#55539)" This reverts commit f2dd6de. * Query Loop: Disallow "enhanced pagination" with core blocks that may contain third-party blocks (#55539) * Update useContainsThirdPartyBlocks and texts * Improve texts a bit * Show the list of unsupported blocks * Use the BlockTitle component instead * Simplify modal text * Revert CSS changes to show/hide embedded pdf (#55667) * Ensure Term Description block is available in core (#55669) Reverts changes in #51053, to address a regression in which the Term Description block was only available in core when the Gutenberg plugin was active. --------- Co-authored-by: Glen Davies <glendaviesnz@users.noreply.github.com> Co-authored-by: David Arenas <david.arenas@automattic.com>
The npm packages needed update for 6.4 RC3. Patch: #5587. This PR includes the following changes: - Regression: [WordPress/gutenberg#55553 Patterns: fix bug with authors and contributors not seeing user pattern categories]. - Bugfix: [WordPress/gutenberg#55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks]. - Regression: [WordPress/gutenberg#55667 File: Fix embedded PDF files in Safari]. - Regression: [WordPress/gutenberg#55669 Ensure Term Description block is registered in core] Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw. See #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@57034 602fd350-edb4-49c9-b593-d223f7449a82
The npm packages needed update for 6.4 RC3. Patch: WordPress/wordpress-develop#5587. This PR includes the following changes: - Regression: [WordPress/gutenberg#55553 Patterns: fix bug with authors and contributors not seeing user pattern categories]. - Bugfix: [WordPress/gutenberg#55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks]. - Regression: [WordPress/gutenberg#55667 File: Fix embedded PDF files in Safari]. - Regression: [WordPress/gutenberg#55669 Ensure Term Description block is registered in core] Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw. See #59411. Built from https://develop.svn.wordpress.org/trunk@57034 git-svn-id: http://core.svn.wordpress.org/trunk@56545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The npm packages needed update for 6.4 RC3. Patch: WordPress/wordpress-develop#5587. This PR includes the following changes: - Regression: [WordPress/gutenberg#55553 Patterns: fix bug with authors and contributors not seeing user pattern categories]. - Bugfix: [WordPress/gutenberg#55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks]. - Regression: [WordPress/gutenberg#55667 File: Fix embedded PDF files in Safari]. - Regression: [WordPress/gutenberg#55669 Ensure Term Description block is registered in core] Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw. See #59411. Built from https://develop.svn.wordpress.org/trunk@57034 git-svn-id: https://core.svn.wordpress.org/trunk@56545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The npm packages needed update for 6.4 RC3. Patch: #5587 This PR includes the following changes: - Regression: [WordPress/gutenberg#55553 Patterns: fix bug with authors and contributors not seeing user pattern categories]. - Bugfix: [WordPress/gutenberg#55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks]. - Regression: [WordPress/gutenberg#55667 File: Fix embedded PDF files in Safari]. - Regression: [WordPress/gutenberg#55669 Ensure Term Description block is registered in core] Reviewed by helloFromTonya. Merges [57034] to the 6.4 branch. Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw. See #59411. git-svn-id: https://develop.svn.wordpress.org/branches/6.4@57035 602fd350-edb4-49c9-b593-d223f7449a82
The npm packages needed update for 6.4 RC3. Patch: WordPress/wordpress-develop#5587 This PR includes the following changes: - Regression: [WordPress/gutenberg#55553 Patterns: fix bug with authors and contributors not seeing user pattern categories]. - Bugfix: [WordPress/gutenberg#55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks]. - Regression: [WordPress/gutenberg#55667 File: Fix embedded PDF files in Safari]. - Regression: [WordPress/gutenberg#55669 Ensure Term Description block is registered in core] Reviewed by helloFromTonya. Merges [57034] to the 6.4 branch. Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw. See #59411. Built from https://develop.svn.wordpress.org/branches/6.4@57035 git-svn-id: http://core.svn.wordpress.org/branches/6.4@56546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Disables enhanced pagination when blocks that can contain third-party blocks are inserted inside the Query Loop block. These blocks are the following:
Why?
The content of those blocks can be edited outside of the Query Loop context, thus allowing the addition of third-party blocks without the required validation.
How?
Adding the names of the aforementioned blocks to the
useContainsThirdPartyBlocks
util.Testing Instructions
Screenshots or screencast
Screen.Recording.2023-10-24.at.11.24.23.mov