WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13133 closed defect (bug) (fixed)

Users with "Contributor" role can't save initial draft with JavaScript disabled

Reported by: foofy Owned by: MarkJaquith
Priority: high Milestone: 3.0
Component: Autosave Version: 3.0
Severity: blocker Keywords: has-patch needs-review
Cc: Jesse.Silverstein@…

Description

Users with the "Contributor" role can't save a new post as draft with JavaScript disabled. They can Submit for Review or edit existing drafts, but they can't post that initial one.

This doesn't seem to be a problem with any of the other roles.

I'm not sure if WordPress requires JavaScript support now, but if it does, shouldn't it check for it? I don't submit tickets so please delete (with my apologies) if I missed something or this is a known issue.

Steps to recreate

  • Disable JavaScript in your browser
  • Log in as a user with the Contributor role (doesn't seem to affect other roles)
  • Go to Posts > Add New to create a new post
  • Hit "Save Draft"

What happens

Post edit screen reloads with the title missing. Draft post is not created and the preview link does not work.

What should happen

A new draft post should have been created.

Attachments (1)

13133.1.diff (449 bytes) - added by jbsil 3 years ago.
logic: If !autosave && status == 'auto-draft' then status = 'draft' in edit_post()

Download all attachments as: .zip

Change History (8)

comment:1 sivel3 years ago

So far I have determined that the post is actually being created, however the post status stays as auto-draft.

comment:2 jbsil3 years ago

  • Cc Jesse.Silverstein@… added
  • Severity changed from normal to blocker

comment:3 sivel3 years ago

  • Component changed from General to Autosave
  • Keywords needs-patch added
  • Owner set to azaozz
  • Priority changed from normal to high

jbsil3 years ago

logic: If !autosave && status == 'auto-draft' then status = 'draft' in edit_post()

comment:4 jbsil3 years ago

  • Keywords has-patch needs-review added; needs-patch removed

post_new creates auto-draft post. admin_ajax converts post_status from 'auto-draft' to 'draft'

copied same logic to edit_post() for js-disabled draft saves.

comment:5 nacin3 years ago

  • Owner changed from azaozz to MarkJaquith
  • Status changed from new to assigned

comment:6 markjaquith3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [14551]) Handle manual saving of auto-drafts for Contributors without JavaScript. props jbsil. fixes #13133

comment:7 nacin3 years ago

(In [16761]) Move [14551] to after the is_wp_error check. see #13133, fixes #15511, props alexdunae.

Note: See TracTickets for help on using tickets.