You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be related to using state (possibly related: WordPress/gutenberg#18755), which is being done primarily to avoid the unsaved changes warning being shown when the user hasn't done anything except load the page, because the field value does need to be cleared out on load (and post-save) but if that's dispatched to meta immediately it's considered a "save". However, this does come with a bug, in that if you don't end up changing the revision note I believe it will still save the old one underneath.
I think there are two paths here, both of which start with getting rid of state and going back to dispatching the change to the editor data directly in onChange:
Figure out how to ignore a given piece of data from whatever it is that tracks the "dirty"/edited state in the block editor, and dispatch to meta.
Use register_rest_field() with an empty string for the get_callback and updating the post meta in update_callback, dispatching the change to said REST field. The existing routine will catch it for the revision. I believe @TimothyBJacobs mentioned something along these lines yesterday that I didn't quite fully grasp at the time, and @johnwatkins0 revived today.
The text was updated successfully, but these errors were encountered:
This seems to be related to using state (possibly related: WordPress/gutenberg#18755), which is being done primarily to avoid the unsaved changes warning being shown when the user hasn't done anything except load the page, because the field value does need to be cleared out on load (and post-save) but if that's dispatched to meta immediately it's considered a "save". However, this does come with a bug, in that if you don't end up changing the revision note I believe it will still save the old one underneath.
I think there are two paths here, both of which start with getting rid of state and going back to dispatching the change to the editor data directly in
onChange
:register_rest_field()
with an empty string for theget_callback
and updating the post meta inupdate_callback
, dispatching the change to said REST field. The existing routine will catch it for the revision. I believe @TimothyBJacobs mentioned something along these lines yesterday that I didn't quite fully grasp at the time, and @johnwatkins0 revived today.The text was updated successfully, but these errors were encountered: