"Move to Trash" with metaboxes prompts about unsaved changes, 500 server error #18269
Labels
[Feature] Meta Boxes
A draggable box shown on the post editing screen
[Feature] Saving
Related to saving functionality
[Type] Bug
An existing feature does not function as intended
Describe the bug
The "Move to Trash" button does not work very well when meta boxes are present on the page:
It appears this is largely caused by a combination of:
gutenberg/packages/edit-post/src/components/browser-url/index.js
Lines 58 to 66 in 3d2b41a
To reproduce
Steps to reproduce the behavior:
Expected behavior
The user is redirected without a prompt or error'd request.
My expectation is that the save request for meta boxes would be skipped when the user tries to save the post, or it must occur prior (or at least prior to the saving of the status to "trash", since as noted in the error message, post values cannot be saved when the post is trashed).
Desktop (please complete the following information):
Additional Context
Most of the relevant code here is contained in the
BrowserURL
component (responsible for redirecting after trashing a post), thetrashPost
action (which sets the status and saves the post), and theedit-post
"effect" for saving meta box values after the default post save procedure.gutenberg/packages/edit-post/src/components/browser-url/index.js
Lines 48 to 51 in 3d2b41a
gutenberg/packages/editor/src/store/actions.js
Lines 324 to 365 in 3d2b41a
gutenberg/packages/edit-post/src/store/effects.js
Lines 51 to 70 in 3d2b41a
The text was updated successfully, but these errors were encountered: