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

Enqueued scripts are not printed on validation screens in WP 4.9 #6775

Closed
westonruter opened this issue Dec 8, 2021 · 2 comments · Fixed by #6773 or #6789
Closed

Enqueued scripts are not printed on validation screens in WP 4.9 #6775

westonruter opened this issue Dec 8, 2021 · 2 comments · Fixed by #6773 or #6789
Assignees
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. P2 Low priority
Milestone

Comments

@westonruter
Copy link
Member

Bug Description

When testing in WP 4.9, I noticed that the Details failed to expand the error info on the Validated URL screen:

image

It's not just that, as the search box doesn't work and the filter doesn't do anything. I believe there is a script dependency present which doesn't exist in 4.9. I tried registering the polyfills:

diff --git a/includes/validation/class-amp-validated-url-post-type.php b/includes/validation/class-amp-validated-url-post-type.php
index d018c774c..066332dfd 100644
--- a/includes/validation/class-amp-validated-url-post-type.php
+++ b/includes/validation/class-amp-validated-url-post-type.php
@@ -2127,6 +2127,9 @@ public static function enqueue_edit_post_screen_scripts() {
 			return;
 		}
 
+		/** This action is documented in includes/class-amp-theme-support.php */
+		do_action( 'amp_register_polyfills' );
+
 		// Eliminate autosave since it is only relevant for the content editor.
 		wp_dequeue_script( 'autosave' );

But this caused errors in the console:

image

In addition to the Validated URL screen, I'm also seeing that the scripts are not printed on the AMP Validated URLs screen, as clicking the tooltips aren't working:

image

This is also the case on the Error Index screen:

image

This is very low priority given the very old WP version.

Expected Behaviour

The UI should work as expected.

Screenshots

No response

PHP Version

No response

Plugin Version

2.2

AMP plugin template mode

Standard, Transitional, Reader

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 P2 Low priority labels Dec 8, 2021
@westonruter
Copy link
Member Author

I think we should just prevent users access to validation screens in WP<5.6.

@delawski
Copy link
Collaborator

QA Passed

✅ The validation screens are not accessible on WP<5.6.

WP 4.9 WP 5.5 WP 5.6
Screenshot 2021-12-15 at 11 47 50 Screenshot 2021-12-15 at 11 47 17 Screenshot 2021-12-15 at 11 46 41

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. P2 Low priority
Projects
None yet
2 participants