Navigation Block: __unstableLocation
can trigger a fatal in block_core_navigation_get_post_ids()
#56600
Labels
[Block] Navigation
Affects the Navigation Block
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Stack trace:
TL:DR We have a site in the latest Gutenberg release (17.1.3) that's throwing a fatal through the use of
__unstableLocation
in a navigation block in a template part.Here's the block markup:
<!-- wp:navigation {"isResponsive":true,"__unstableLocation":"primary","style":{"typography":{"fontStyle":"normal","fontWeight":"500"}}} /-->
Investigation so far:
iterator_to_array()
function is expecting a WP_Block_List but is given an empty string.block_core_navigation_render_inner_blocks
filter,$inner_blocks
is just an empty string.where an empty menu returns an empty string, or perhaps it's returning
\n\n
as noted by this navigation function.I appreciate this is quite a vague report that I cannot currently re-produce on a standard theme, any insight appreciated.
This PR seems related to a similar area, but not the root cause of this issue: #56459
Step-by-step reproduction instructions
I can't currently reproduce this issue.
Screenshots, screen recording, code snippet
Current theme patch that's resolving this issue:
Environment info
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
The text was updated successfully, but these errors were encountered: