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 custom status error with Gutenberg 7.2+ #584

Closed
wants to merge 3 commits into from

Conversation

cojennin
Copy link
Contributor

A fix for #583. Continuing to break the rules, but for a good cause.

Props to @ryelle for tracking this down

Steps to Test

  1. With Gutenberg 7.2 or 7.3
  2. With the custom status module active
  3. Try to edit a draft post
  4. Editor should not crash

@cojennin cojennin changed the title Fix custom status error with Gutenberg Fix custom status error with Gutenberg 7.2+ Jan 23, 2020
@cojennin cojennin force-pushed the fix/custom-status-gutenberg branch from 6c4fe49 to ea53777 Compare January 23, 2020 03:55
@cojennin cojennin force-pushed the fix/custom-status-gutenberg branch from 7eb1990 to fc711ee Compare January 23, 2020 15:36
@ryelle
Copy link
Member

ryelle commented Jan 23, 2020

Loading, editing, and saving a draft works, but after the draft finishes saving, the button reverts to "save draft"

Screen Shot 2020-01-23 at 11 16 32 AMScreen Shot 2020-01-23 at 11 16 22 AM

I'm also seeing a crash with a custom status ("assigned")— this time, the post loads fine, but crashes when I try to save it. The error is the same:

Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

@WPprodigy
Copy link
Contributor

WPprodigy commented Jan 23, 2020

I can replicate the above as well.

Seems GB is changing the markup pretty drastically during the saving states. Perhaps utilizing more of the selectors could help here, like select( 'core/editor' ).isSavingPost(). Also, subscribe() isn't re-triggered when saving is done, that's why it ends up in the "save draft" state at the end still.

Also noting that WordPress/gutenberg#12517 (filtering text strings) is another issue to watch as a better way to solve this.

I'll see what I can find/do later this evening.

Edit: Ugh, and there is also WordPress/gutenberg#17632 (fire hook when post is finished saving) that would help here (was closed in favor of WordPress/gutenberg#13413, though it is a bit different IMO).

@WPprodigy
Copy link
Contributor

Tried a different approach in #585

@cojennin
Copy link
Contributor Author

Closing in favor of #585

@cojennin cojennin closed this Jan 24, 2020
@cojennin cojennin deleted the fix/custom-status-gutenberg branch January 29, 2020 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants