-
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: Require queryId for enhanced pagination to prevent PHP notices. #55720
Conversation
cb33d90
to
21480de
Compare
Test ReportThis report validates that the indicated patch addresses the issue. Environment
Actual Results
|
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.
See my test report which confirms:
- can reproduce the PHP Warning before this PR
- this PR resolves the issue.
React Native e2e tests (Android): |
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 for the fix, @peterwilsoncc! 🙏
The enhanced pagination indeed requires the queryId
attribute to be set to generate the data-wp-navigation-id
prop, so this change makes total sense.
I just cherry-picked this PR to the 6.4-rc3-2 branch to get it included in the next release: de980d5 |
Thanks for merging this promptly. I've created #55747 as a follow up to investigate whether the ID can be autogenerated if it's missing in order to respect developer intent. |
* Update label for lightbox editor UI (#55724) * Update label for lightbox editor UI * Change lightbox label in Global Styles * Require queryId for enhanced pagination. (#55720) * Change pattern category taxonomy public param to false (#55748) * Query block enhanced pagination: Detect inner plugin blocks during render (#55714) * Flag inner plugin blocks inside query loop * Improve PHP logic a little * Only disallow plugin blocks and post content * Get rid of global variables * Fix returned content from render callback * Handle composed query stacks * Disable navigation on the browser * Replace `count` with `empty` * Add PHPdocs and improve var naming * Lint PHP * Clarify docs a little * Move the disable check before preventDefault * Restore previous navigate logic * Set filter priorities back to 10 * Basic inspector warnings * Make render query filter static * Add stable modal logic * Switch back to ToggleControl * Auto remove filter when query stack is empty * Add first unit tests * Switch to inverse control * Add test case for nested queries * Prevent passing `null` to the Tag Processr * Get rid of explicit auto mode and notices * Test directives in the Pagination Previous block * Minor typos and improvements * Improve modal texts * Fix WPCS * Reorder teardowns * Reset the dirty flag after it's used * Prevent usage of post content block --------- Co-authored-by: David Arenas <[email protected]> * Reuse existing screen-reader-text CSS class. (#55309) --------- Co-authored-by: Artemio Morales <[email protected]> Co-authored-by: Peter Wilson <[email protected]> Co-authored-by: Glen Davies <[email protected]> Co-authored-by: Luis Herranz <[email protected]> Co-authored-by: David Arenas <[email protected]> Co-authored-by: Andrea Fercia <[email protected]>
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. Built from https://develop.svn.wordpress.org/trunk@57048 git-svn-id: http://core.svn.wordpress.org/trunk@56559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. Built from https://develop.svn.wordpress.org/trunk@57048 git-svn-id: https://core.svn.wordpress.org/trunk@56559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Reviewed by davidbaumwald , jorbin. Merges [57048] to the 6.4 branch. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. git-svn-id: https://develop.svn.wordpress.org/branches/6.4@57049 602fd350-edb4-49c9-b593-d223f7449a82
This second update for RC3 includes the following fixes: * [WordPress/gutenberg#55724 Update label for lightbox editor UI] - string change. * [WordPress/gutenberg#55720 Query: Require queryId for enhanced pagination to prevent PHP notices] and warnings. * [WordPress/gutenberg#55714 Query block enhanced pagination: Detect inner plugin blocks during render] - which avoids turning off enhanced pagination in TT4, includes string changes. * [WordPress/gutenberg#55309 Query Loop block: Reuse existing screen-reader-text CSS class for the enhanced pagination aria-live region]. Follow up to [57034], [56987], [56961], [56849], [56818], [56816]. Reviewed by davidbaumwald , jorbin. Merges [57048] to the 6.4 branch. Props afercia, aristath, artemiosans, czapla, darerodz, glendaviesnz, hellofromTonya, jameskoster, joen, luisherranz, mikachan, ocean90, peterwilsoncc, ramonopoly, rajinsharwar, swissspidy. Fixes #59411. Built from https://develop.svn.wordpress.org/branches/6.4@57049 git-svn-id: http://core.svn.wordpress.org/branches/6.4@56560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Adds a check to ensure the Query ID is set before rendering enhanced pagination.
Fixes #55719.
Why?
Without a Query ID the enhanced pagination will throw a notice. The Query ID doesn't include a default so can be unset.
How?
Within
render_block_core_query()
the conditions checking$attributes['enhancedPagination']
are modified to also checkisset( $attributes['queryId'] )
. If either item is not set then the feature is not enabled.Testing Instructions
templates/index.html
wp post generate
Testing Instructions for Keyboard
N/A
Screenshots or screencast