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

Prevent store_validation_errors from clobbering global post when empty invalid_url_post supplied #1433

Merged
merged 1 commit into from Sep 14, 2018

Conversation

Projects
None yet
2 participants
@westonruter
Copy link
Member

westonruter commented Sep 14, 2018

Another fix for regression introduced #1426. See also #1428.

When creating a post in Gutenberg and publishing, and then making a change to then update, at that point the invalid URL post replaces the post you're editing.

The issue is that I switched from a boolean check here https://github.com/Automattic/amp-wp/pull/1426/files#diff-57518db0811ee918fee17d27459ed4ecL358:

image

So switching back to an empty() check fixes the problem.

@westonruter westonruter added this to the v1.0 milestone Sep 14, 2018

@westonruter westonruter requested a review from amedina Sep 14, 2018

@@ -360,9 +360,11 @@ public static function get_url_from_post( $post ) {
public static function store_validation_errors( $validation_errors, $url, $args = array() ) {

This comment has been minimized.

Copy link
@amedina

amedina Sep 14, 2018

Member

Not for now but may consider splitting this function? Kind of long.

@westonruter westonruter merged commit e63a879 into develop Sep 14, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the fix/store-validation-errors branch Sep 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.