-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Gutenberg: Autosave not saving Categories and tags #28771
Comments
Thanks @JavonDavis I verified the behavior 👍 |
I gave this a quick look: apparently there is a slight difference between Gutenberg in Core and in WPCOM when it comes to autosaves and previews. In both cases, the autosave does not include categories and tags, while the normal save does. Upon clicking the Preview button, Core always saves (not "autosaves"!) the post first, but WPCOM doesn't. |
As it happens, I got the Gutenberg versions wrong. Core Gutenberg started saving the post when clicking "Preview" only on version 4.5 (WordPress/gutenberg#12097), but the version of Gutenberg on WPCOM is currently the 4.4.0 (D21226-code updates to 4.5.1). I've tried applying that patch, and it started saving categories and tags before opening the preview. I'll close this for now because the fix is scheduled to land very soon. |
Just FYI, 4.5.1 got merged yesterday (p7DVsv-5In-p2), and I can't reproduce this anymore. 🙂 |
Awesome! @Copons do you know when it will be live? or how are you testing it right now? I've tried on dotcom and the latest version of calypso from master and not seeing the fix |
The update is live, but you are right @JavonDavis, it's not fixed. Basically we need to observe the In Core, this is what happens:
In WPCOM, instead:
The difference is that My previous comment failed in repro because I was in fact Previewing between the set-title and the autosave, which is indeed the only moment when I'll reopen this and also involve other folks that might be more familiar than me on this flow. |
An autosave is only intended to store a couple fields, which does not include terms:
https://codex.wordpress.org/Revisions#Revision_Storage_Method In fact, I'd be more intrigued if these are saved in core. |
To expand, the behavior of "autosave" varies between drafts and published posts, only using revisions for the latter. Autosaving a draft post would incur a full save, which arguably could (?) include terms. |
@aduth Indeed the autosave doesn't save tags and categories. The side effect is that tags and categories show up correctly in the preview. Problem is that in WPCOM this full save does not happen, as the What I didn't get around to figure out is why |
Based on your previous debugging, I think it'd have to be the result of this check: Do we receive into state an autosave in Calypso? |
@aduth I've tried again with a load of live expressions monitoring all the checks of the There is a cute little prop that I wasn't paying attention to: That And... yeah. My sandbox doesn't use meta boxes, while my local install of Gutenberg does. So basically the fact that my Core Guten saved tags and categories on preview, was for unrelated reasons, and in fact WPCOM Guten is behaving as expected (aka: like Core Guten). Though, I think @JavonDavis's issue is still valid, but it should be opened in Core instead. |
Possibly related: #28974 |
Opened a Core Guten issue, but it might be working as expected: WordPress/gutenberg#12472
@alisterscott most likely unrelated, but I've left some comments on both that issue and the Core Guten equivalent. 👍 |
I'm closing this because I think everything is working as expected, and changing the autosave behaviour is a Core thing (WordPress/gutenberg#12472, also already discussed plenty of times before). |
There's an issue with Autosaving of Categories and Tags. If the post isn't saved via
Save Draft
orUpdate
Tags and Categories are not saved. Navigating away from the page will also let you know there are still unsaved changes after the Autosaving completes.Steps to reproduce
What I expected
Expected the tags and Categories to be present on the post in the Preview
What happened instead
Browser / OS version
Mac OS Mojave, Chrome v70
The text was updated successfully, but these errors were encountered: