gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Autosave forces 'Uncategorized' within seconds

Open mor10 opened this issue 8 years ago • 6 comments

Issue Overview

When creating a new post, no category should be applied until the author has interacted with the save / publish button to avoid the Uncategorized category being applied to every post.

Steps to Reproduce (for bugs)

  1. Create new post.
  2. Add title.
  3. Watch the Uncategorized category be applied
  4. Throw your computer out the window.
  5. Regret step 4.

Expected Behavior

When creating a new post, no category should be applied until the author has interacted with the save / publish button to avoid the Uncategorized category being applied to every post.

Current Behavior

Within seconds of giving a new post a title, the post is given the 'Uncategorized' category.

Possible Solution

Not sure.

mor10 avatar Jan 22 '18 04:01 mor10

You and me both, but it's a core issue. I'm fine with that behaviour going away, but it needs to be fixed in wp_insert_post(), which enforces that post post types have at least one category.

Ref: https://core.trac.wordpress.org/ticket/14901

pento avatar Jan 22 '18 06:01 pento

  • throws computer out the window *

mor10 avatar Jan 22 '18 07:01 mor10

@mor10 With Classic Editor the default category is also set by core for an autosaved post, but the category is not automatically checked/shown in UX while still editing the post. Nothing is checked.

With Gutenberg you need an additional click (uncheck default if you set another category), so it is clearly a Gutenberg issue.

ghost avatar Jan 22 '18 10:01 ghost

I've done some user testing. This is most definitely a Gutenberg issue. @pento, can you re-open the ticket or should I file a new one?

Specifically, this issue is made more prominent by the default behavior of the publish panel. When a new post is created, the creator sees the simplified panel with the Publish button, but is not aware of the categories etc unless they explicitly close that panel and make a change. The result is almost everyone I've tested this on (myself included), accidentally publishes posts without setting the category and then have to go back and fix it after publishing. It's a bad user flow.

mor10 avatar Jan 23 '18 17:01 mor10

@tkes: That's a bug in Classic Editor - the UI isn't updated to reflect the actual state of the post. Gutenberg is behaving correctly in that respect.

@mor10: Please open a new issue for the user flow problem, we can leave this issue as a monument to Core's hilariously quirky default behaviour..

pento avatar Jan 24 '18 12:01 pento

That's a bug in Classic Editor - the UI isn't updated to reflect the actual state of the post. Gutenberg is behaving correctly in that respect.

Calling this a bug doesn't seem correct. It also seems wrong to conflate this with wp_insert_post() enforcing category assignment.

It's a good thing the category UI isn't updated to reflect the state of the post prior to saving in the Classic Editor. This saves a pointless click to dissociate Uncategorised as a category each time a new post is created.

Perhaps the original issue could have been: "When creating a new post, the category UI should not be updated until the author has interacted with the save / publish button to avoid the Uncategorized category being applied to every post." This matches the experience in Classic Editor: Uncategorised is assigned as a fallback where no category has been assigned by the user.

chthonic-ds avatar Jan 27 '18 00:01 chthonic-ds