Skip to content

Call to undefined function block_core_navigation_get_menu_items_at_location #56453

@NickGreen

Description

@NickGreen

Description

This fatal is bringing down some sites:
[22-Nov-2023 21:01:30 UTC] PHP Fatal error: Uncaught Error: Call to undefined function block_core_navigation_get_menu_items_at_location() in /srv/htdocs/wp-content/plugins/gutenberg/lib/compat/wordpress-6.5/class-wp-navigation-block-renderer.php:248

Step-by-step reproduction instructions

  1. Update to a Gutenberg version greater than 17.0.1
  2. Update to WordPress 6.4.1
  3. Get a critical error screen

Deactivating Gutenberg brings the site back.

Screenshots, screen recording, code snippet

[22-Nov-2023 21:01:30 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function block_core_navigation_get_menu_items_at_location() in /srv/htdocs/wp-content/plugins/gutenberg/lib/compat/wordpress-6.5/class-wp-navigation-block-renderer.php:248
Stack trace:
#0 /srv/htdocs/wp-content/plugins/gutenberg/lib/compat/wordpress-6.5/class-wp-navigation-block-renderer.php(628): WP_Navigation_Block_Renderer::get_inner_blocks(Array, Object(WP_Block))
#1 /srv/htdocs/wp-content/plugins/gutenberg/build/block-library/blocks/navigation.php(413): WP_Navigation_Block_Renderer::render(Array, '', Object(WP_Block))
#2 /wordpress/core/6.4.1/wp-includes/class-wp-block.php(258): gutenberg_render_block_core_navigation(Array, '', Object(WP_Block))
#3 /wordpress/core/6.4.1/wp-includes/class-wp-block.php(244): WP_Block->render()
#4 /wordpress/core/6.4.1/wp-includes/blocks.php(1484): WP_Block->render()
#5 /wordpress/core/6.4.1/wp-includes/blocks.php(1522): render_block(Array)
#6 /srv/htdocs/wp-content/plugins/gutenberg/build/block-library/blocks/template-part.php(144): do_blocks('<!-- wp:group {...')
#7 /srv/htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTemplatesController.php(171): gutenberg_render_block_core_template_part(Array)
#8 /wordpress/core/6.4.1/wp-includes/class-wp-block.php(258): Automattic\WooCommerce\Blocks\BlockTemplatesController->render_woocommerce_template_part(Array, '', Object(WP_Block))
#9 /wordpress/core/6.4.1/wp-includes/blocks.php(1484): WP_Block->render()
#10 /wordpress/core/6.4.1/wp-includes/blocks.php(1522): render_block(Array)
#11 /wordpress/core/6.4.1/wp-includes/block-template.php(263): do_blocks('<!-- wp:templat...')
#12 /wordpress/core/6.4.1/wp-includes/template-canvas.php(12): get_the_block_template_html()
#13 /wordpress/core/6.4.1/wp-includes/template-loader.php(106): include('/wordpress/core...')
#14 /wordpress/core/6.4.1/wp-blog-header.php(19): require_once('/wordpress/core...')
#15 /wordpress/core/6.4.1/index.php(17): require('/wordpress/core...')
#16 {main}
  thrown in /srv/htdocs/wp-content/plugins/gutenberg/lib/compat/wordpress-6.5/class-wp-navigation-block-renderer.php on line 248

Environment info

WordPress 6.4.1
Gutenberg Plugin versions > 17.0.1

(rolling back to 17.0.1 fixes the problem)

We have access to a development site which is currently displaying this fatal, if anyone would like a testing environment. We can also help verify any fixes.

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

Labels

[Block] NavigationAffects the Navigation Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions