Skip to content

Validation issue with WP 6.1 core navigation block #7322

Closed
@milindmore22

Description

@milindmore22

Bug Description

The core navigation block enqueues a script for the block, creating an invalidation in the core.

The error is reproducible with Twenty Twenty-Two and Twenty Twenty-three theme

{
	"node_name": "script",
	"parent_name": "head",
	"code": "DISALLOWED_TAG",
	"type": "js_error",
	"node_attributes": {
		"src": "http://one.wordpress.test/wp-includes/blocks/navigation/view-modal.min.js?ver=__normalized__",
		"id": "wp-block-navigation-view-2-js"
	},
	"node_type": "ELEMENT",
	"sources": [
		{
			"type": "core",
			"name": "wp-includes",
			"file": "blocks/navigation.php",
			"line": 668,
			"function": "register_block_core_navigation",
			"hook": "init",
			"priority": 10,
			"dependency_type": "script",
			"handle": "wp-block-navigation-view-2"
		},
		{
			"type": "core",
			"name": "wp-includes",
			"file": "blocks/template-part.php",
			"line": 15,
			"function": "render_block_core_template_part",
			"dependency_type": "script",
			"handle": "wp-block-navigation-view-2"
		},
		{
			"type": "core",
			"name": "wp-includes",
			"file": "script-loader.php",
			"line": 2127,
			"function": "wp_print_head_scripts",
			"hook": "wp_head",
			"priority": 9
		}
	],
	"removed": true,
	"reviewed": false
}

However, the menu toggle is working on AMP pages.

Expected Behaviour

The Core and Core themes should not create validation issues

Screenshots

image

PHP Version

7.4.3

Plugin Version

2.3.0

AMP plugin template mode

Standard, Transitional

WordPress Version

6.1-RC3

Site Health

No response

Gutenberg Version

No response

OS(s) Affected

No response

Browser(s) Affected

No response

Device(s) Affected

No response

Acceptance Criteria

No response

Implementation Brief

No response

QA Testing Instructions

No response

Demo

No response

Changelog Entry

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingChangeloggedWhether the issue/PR has been added to release notes.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions