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

Fix enqueueing amp-runtime and handling comment submissions in paired mode #1033

Merged
merged 3 commits into from
Mar 22, 2018

Conversation

westonruter
Copy link
Member

Fixes #1028:

  1. When in paired mode, if I submit the comment at https://paired-ampconfdemo.pantheonsite.io/2018/02/06/are-you-there-lebron-its-me-lebron-a-superstars-ultimate-pep-talk/amp/ then it will redirect me to the non-AMP article. The comment_post_redirect filter should be making sure that if paired mode is enabled that it redirects to the AMP version of the post instead.

  2. Related: when in non-paired mode such as at https://paired-ampconfdemo.pantheonsite.io/2018/02/06/are-you-there-lebron-its-me-lebron-a-superstars-ultimate-pep-talk/#respond I cannot submit the form. Why? Because the amp-runtime script is erroneously getting enqueued. This results in:

image

This regression was introduced in #1023

  1. When submitting a comment from a site I can see now that _wp_amp_action_xhr_converted really should be used to determine whether the logic in AMP_Theme_Support::handle_xhr_request() runs.

@westonruter westonruter added this to the v0.7 milestone Mar 22, 2018
@westonruter westonruter requested a review from kienstra March 22, 2018 00:24
@westonruter westonruter changed the base branch from develop to 0.7 March 22, 2018 00:25
@westonruter westonruter force-pushed the fix/paired-mode-xhr branch from 2364049 to 213d195 Compare March 22, 2018 00:25
@kienstra kienstra self-assigned this Mar 22, 2018
Copy link
Contributor

@kienstra kienstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Hi @westonruter,
This pull request looks good. Nice use of WP_UnitTestCase::go_to().

@westonruter westonruter merged commit 7870892 into 0.7 Mar 22, 2018
@westonruter westonruter deleted the fix/paired-mode-xhr branch March 22, 2018 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants