-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Block] Query LoopAffects the Query Loop BlockAffects the Query Loop Block[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
Enhanced pagination of the query block throws notices if the query ID is not defined.
Notice: Undefined index: queryId in .../gutenberg/build/block-library/blocks/query.php on line 150
Notice: Undefined index: queryId in .../gutenberg/build/block-library/blocks/query.php on line 25
Notice: Undefined index: queryId in .../gutenberg/build/block-library/blocks/query.php on line 170
In the Site Editor, it appears this is prevented from happening, so the issue only occurs if the incorrect markup is used in the files of a distributed theme.
I think if the queryId is not defined, then enhanced pagination can be prevented. Generating a queryId could work but may lead to collisions if there are two queries on the page and one of them has the value defined.
Step-by-step reproduction instructions
- Enabled debug mode in your wp-config file:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', true );
- Download and activate peters-sample-theme.zip which contains bad markup in
templates/index.html
- Visit the theme on the front end of the site.
- Observe the notices thrown
Screenshots, screen recording, code snippet
Stack trace attached, it's quite a lot because it's generated with xdebug enabled.
Environment info
- WordPress trunk (6.5-alpha @ https://github.com/wordPress/wordpress/commits/cc0246c154bc090bc95849f27a2747b3e524f116 )
- Gutenberg trunk @ 929a37d
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Metadata
Metadata
Assignees
Labels
[Block] Query LoopAffects the Query Loop BlockAffects the Query Loop Block[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended