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

westonruter
Copy link
Member

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
@@ -360,9 +360,11 @@ public static function get_url_from_post( $post ) {
public static function store_validation_errors( $validation_errors, $url, $args = array() ) {
Copy link
Member

Choose a reason for hiding this comment

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

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

@westonruter westonruter merged commit e63a879 into develop Sep 14, 2018
@westonruter westonruter deleted the fix/store-validation-errors branch September 14, 2018 19:07
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