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

Plugin: Fix saving new posts by making the post type mandatory #1395

Merged
merged 2 commits into from
Jun 23, 2017

Conversation

youknowriad
Copy link
Contributor

#1276 introduced a regression where saving new posts was broken because it assumes the post type is always present in the store.

I'm fixing this by making the post param to createEditorInstance mandatory with a post type.

@youknowriad youknowriad added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended labels Jun 23, 2017
@youknowriad youknowriad self-assigned this Jun 23, 2017
@jasmussen
Copy link
Contributor

Fast work! Nice work! Fixes it for me! Can't comment on the code, but 👍 from me.

wp_add_inline_script(
'wp-editor',
'window._wpGutenbergPost = ' . wp_json_encode( $empty_post ) . ';'
);
Copy link
Member

@nylen nylen Jun 23, 2017

Choose a reason for hiding this comment

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

Error handling is still TODO here. Let's not remove that comment yet. Edit: Done in db4d9a1

Copy link
Member

@nylen nylen left a comment

Choose a reason for hiding this comment

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

Code seems fine to me, though we need integration tests to prevent issues like this in the future.

@youknowriad youknowriad merged commit 7f36759 into master Jun 23, 2017
@youknowriad youknowriad deleted the fix/saving-new-posts branch June 23, 2017 13:14
@mtias
Copy link
Member

mtias commented Jun 23, 2017

Agreed we cannot be regressing like this at this stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants