Skip to content
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

Search block with "button only" configuration is broken #7677

Open
westonruter opened this issue Nov 9, 2023 · 0 comments
Open

Search block with "button only" configuration is broken #7677

westonruter opened this issue Nov 9, 2023 · 0 comments
Assignees
Labels
Bug Something isn't working P1 Medium priority
Milestone

Comments

@westonruter
Copy link
Member

westonruter commented Nov 9, 2023

Bug Description

When configuring the Search block so that the button position is set to "button only", the results is validation errors on on the AMP page and a Search button that does nothing when clicked. It should work like this:

Screen.recording.2023-11-09.09.30.30.webm

The validation errors are due to the two scripts being enqueued for the Interactivity API.

2 validation errors
[
	{
		"node_name": "script",
		"parent_name": "head",
		"code": "DISALLOWED_TAG",
		"type": "js_error",
		"node_attributes": {
			"src": "http://localhost:10003/wp-includes/js/dist/interactivity.min.js?ver=__normalized__",
			"id": "wp-interactivity-js",
			"defer": "defer",
			"data-wp-strategy": "defer"
		},
		"node_type": "ELEMENT",
		"sources": [
			{
				"type": "core",
				"name": "wp-includes",
				"file": "blocks/search.php",
				"line": 199,
				"function": "register_block_core_search",
				"hook": "init",
				"priority": 10,
				"dependency_type": "script",
				"handle": "wp-block-search-view",
				"dependency_handle": "wp-interactivity"
			},
			{
				"type": "core",
				"name": "wp-includes",
				"file": "blocks/template-part.php",
				"line": 15,
				"function": "render_block_core_template_part",
				"dependency_type": "script",
				"handle": "wp-block-search-view",
				"dependency_handle": "wp-interactivity"
			},
			{
				"type": "core",
				"name": "wp-includes",
				"file": "script-loader.php",
				"line": 659,
				"function": "wp_default_packages",
				"hook": "wp_default_scripts",
				"priority": 10,
				"dependency_type": "script",
				"handle": "wp-interactivity"
			},
			{
				"type": "core",
				"name": "wp-includes",
				"file": "blocks/file.php",
				"line": 92,
				"function": "register_block_core_file",
				"hook": "init",
				"priority": 10,
				"dependency_type": "script",
				"handle": "wp-interactivity"
			},
			{
				"type": "core",
				"name": "wp-includes",
				"file": "script-loader.php",
				"line": 2209,
				"function": "wp_print_head_scripts",
				"hook": "wp_head",
				"priority": 9
			}
		],
		"removed": true,
		"reviewed": false
	},
	{
		"node_name": "script",
		"parent_name": "head",
		"code": "DISALLOWED_TAG",
		"type": "js_error",
		"node_attributes": {
			"src": "http://localhost:10003/wp-includes/blocks/search/view.min.js?ver=__normalized__",
			"id": "wp-block-search-view-js",
			"defer": "defer",
			"data-wp-strategy": "defer"
		},
		"node_type": "ELEMENT",
		"sources": [
			{
				"type": "core",
				"name": "wp-includes",
				"file": "blocks/search.php",
				"line": 199,
				"function": "register_block_core_search",
				"hook": "init",
				"priority": 10,
				"dependency_type": "script",
				"handle": "wp-block-search-view"
			},
			{
				"type": "core",
				"name": "wp-includes",
				"file": "blocks/template-part.php",
				"line": 15,
				"function": "render_block_core_template_part",
				"dependency_type": "script",
				"handle": "wp-block-search-view"
			},
			{
				"type": "core",
				"name": "wp-includes",
				"file": "script-loader.php",
				"line": 2209,
				"function": "wp_print_head_scripts",
				"hook": "wp_head",
				"priority": 9
			}
		],
		"removed": true,
		"reviewed": false
	}
]

Expected Behaviour

Behavior on AMP page should match non-AMP page. No validation errors should occur.

Screenshots

image

PHP Version

n/a

Plugin Version

2.5.0

AMP plugin template mode

Standard, Transitional

WordPress Version

No response

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

@westonruter westonruter added Bug Something isn't working P1 Medium priority labels Nov 9, 2023
@westonruter westonruter added this to the v2.5.1 milestone Nov 9, 2023
@westonruter westonruter modified the milestones: v2.5.1, v2.5.2 Dec 18, 2023
@westonruter westonruter modified the milestones: v2.5.2, v2.5.3 Jan 8, 2024
@westonruter westonruter modified the milestones: v2.5.3, v2.5.4 Mar 14, 2024
@westonruter westonruter modified the milestones: v2.5.4, v2.6 May 2, 2024
@github-project-automation github-project-automation bot moved this to To Do in Ongoing Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working P1 Medium priority
Projects
Status: To Do
Development

No branches or pull requests

2 participants