-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Autosave: Also save tags and categories #12472
Comments
Noting that #7767 sounds similar and was marked as invalid. For me, it would be nice to clarify the expected behaviors around autosaves and previews for both drafts and published posts:
Related:
|
I just tested with Twenty Twenty One theme. Followed the testing procedure as mentioned by @Copons Create a new post. The preview shows categories and tags that I set. It shows the category Books and News. The tags In the sun, Night and Weather. Based on my findings I will go ahead and close this issue. @Copons or anyone else please reopen if there are other concerns that I have missed. I do believe all the issues/PR's @designsimply linked to have either been closed or merged |
Related to Automattic/wp-calypso#28771
Context
The original issue reported this:
The reason is that the autosave doesn't save categories and tags.
Although, in our initial investigation, this issue only occurred on WP.com, but didn't on WP.org.
It took me a while to figure why.
PostPreviewButton
under certain conditions performs a full save when opening the Preview:gutenberg/packages/editor/src/components/post-preview-button/index.js
Lines 141 to 154 in a92216b
On my WP.com site,
isAutosaveable
was always false, and therefore the button early-returned before performing the save.On the WP.org one, instead, it was always true.
This is because of the
forceIsAutosaveable
prop, set from the parent component:gutenberg/packages/edit-post/src/components/header/index.js
Lines 54 to 57 in a92216b
And now it became obvious: my WP.org site has meta boxes, while my WP.com one doesn't.
Doubts and Questions
At first I wanted to propose to perform a full save on Preview in any case, in order to view the correct category, tags, and possibly many more post attributes.
Though, this would be ill-advised, because we don't really want to stealth-save a published post with changes that might not be final yet.
Then I wondered if it was just enough to drop the
isAutosaveable
check, and always perform either a full save on drafts, or an autosave on published.This would solve the issue for drafts, but not at all for published.
So, assuming I'm not the only one bothered by this issue (well, me and Calypso e2e tests 😄), I'm wondering if it could make sense to extend autosave to also save categories, tags, and possibly other post attributes that might be very obviously missing from the preview.
The text was updated successfully, but these errors were encountered: