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

Ignore WordPress core when there is another error source in block editor AMP sidebar #6667

Closed
delawski opened this issue Oct 29, 2021 · 1 comment · Fixed by #6675
Closed
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. P0 High priority Validation
Milestone

Comments

@delawski
Copy link
Collaborator

delawski commented Oct 29, 2021

Bug Description

When a plugin generates a validation error by rendering invalid code in the block editor, the AMP Validation sidebar says WordPress core is the error source:

image

It seems the logic in the editor sidebar needs to be updated to treat Gutenberg like WordPress core, and also to ignore WordPress core when there is another source (e.g. a theme/plugin).

See: #6610 (comment)


Steps to reproduce

  1. Create a new plugin that will add a shortcode. The shortcode should generate invalid AMP markup, e.g.:
<?php
/*
Plugin Name: Bad Tag Shortcode
*/

add_shortcode( 'bad-tag-shortcode', function () {
	return '<bad-tag-shortcode></bad-tag-shortcode>';
} );
  1. Create a new post and add the new [bad-tag-shortcode] (via the Shortcode block).
  2. Save and check out the AMP Validation sidebar in the block editor. It should say that the WordPress core is responsible for the <bad-tag-shortcode> error:
    Screenshot 2021-10-29 at 15 33 32

Expected Behaviour

The logic in the editor sidebar needs to be updated to treat Gutenberg like WordPress core, and also to ignore WordPress core when there is another source (e.g. a theme/plugin).

Screenshots

No response

PHP Version

No response

Plugin Version

2.2.0-alpha

AMP plugin template mode

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

@bartoszgadomski
Copy link
Contributor

QA passed:

Source of an invalid element is correctly identified:
Screenshot 2021-11-22 at 12 46 26

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. P0 High priority Validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants