WordPress.org

Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#4416 closed defect (bug) (duplicate)

Save and Continue Editing with blank title/body gets to bad state

Reported by: jhodgdon Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Administration Keywords: save, post, has-patch
Focuses: Cc:

Description

Log into your WordPress admin panel.

Click "Write" to create a new post. It does not matter if you are using the rich text editor or plain editor.

Click "Save and Continue Editing", without entering a title or body for your post. (For instance, someone might check a category or enter some other metadata and click Save and Continue Editing; but to reproduce this bug, you can just immediately click Save and Continue Editing)

You will be redirected to a page with the following URL, relative to your blog dir:

wp-admin/post.php?action=edit&post=0

You will see a blank post editing screen, except that any edits you might have made in post metadata, categories, etc., and your usual post defaults (comment/trackback preferences), are all lost.

I think the correct behavior should be (assuming we don't want to save a post with no title/content) to open up the default post again (as if user just clicked on Write), and to warn the user that the post was empty and not saved, up at the top of the screen in one of those handy-dandy fading message bars.

I originally found this bug on a site running 2.1.x. I then verified it is still there in 2.2, and also in [5655], on a fresh install from scratch with no plugins running.

Attachments (1)

wp-admin-post.diff (1.2 KB) - added by jhodgdon 13 years ago.
Patches to wp-admin/post.php and wp-admin/post-new.php, which make it so Save and Continue Editing on a blank post goes to new Write screen with warning message at top of screen

Download all attachments as: .zip

Change History (6)

@jhodgdon
13 years ago

Patches to wp-admin/post.php and wp-admin/post-new.php, which make it so Save and Continue Editing on a blank post goes to new Write screen with warning message at top of screen

#1 @jhodgdon
13 years ago

  • Keywords has-patch added

#2 @jhodgdon
13 years ago

Note that patch above also causes the same (I think desirable) behavior to happen if you go to the Write page and click Save rather than Save and Continue Editing.

#3 @westi
13 years ago

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

This was duped by #4855 (after the 0 post id had been killed my another commit)

Fixed by [5967]

Marking as Fixed.

#4 @foolswisdom
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#5 @foolswisdom
13 years ago

  • Milestone 2.3 deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.