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

Add missing amp-block-validation dependency. #1393


Copy link

@felixarntz felixarntz commented Sep 3, 2018

Currently, in Gutenberg I receive an error in the console because the amp-block-validation.js file tries to access the wpAmpEditor global. That global is set via wp_localize_script() attached to the amp-block-editor-toggle-compiled.js file. As the latter is not a dependency of amp-block-validation, it may load later, causing the error to be thrown.

By adding amp-block-editor-toggle-compiled.js, this issue can be fixed. As a side observation, we might also want to replace wp_localize_script() with a call to wp_add_inline_script(), but that isn't part of the bugfix, so I didn't include it here.

Copy link

@westonruter westonruter commented Sep 3, 2018

Looks like unit test needs to be updated for this change. Also, feel free to include the switch to wp_add_inline_script().

@westonruter westonruter added this to the v1.0 milestone Sep 5, 2018
@westonruter westonruter merged commit db60442 into ampproject:develop Sep 5, 2018
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants