WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#4855 closed defect (bug) (fixed)

"Save and Continue Editing" is broken

Reported by: Viper007Bond Owned by:
Milestone: 2.3 Priority: highest omg bbq
Severity: blocker Version: 2.3
Component: Administration Keywords: has-patch tested dev-reviewed commit
Focuses: Cc:

Description

Go to the Write post screen and then click "Save and Continue Editing". You get redirected to post.php?action=edit&post=0. Note the post ID.

Don't have time to find the problem and solution at the moment. If no one patches it up, I'll look into it later.

Attachments (2)

edit-form-advanced.php.diff (567 bytes) - added by BoltClock 7 years ago.
The patch
empty_post_redirect.diff (775 bytes) - added by ryan 7 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 ryan7 years ago

Due to [5875] for #4737 ?

comment:2 Viper007Bond7 years ago

That's what I thought at first too, but that's occurring after the fact.

i.e. you click the button, it saves it / whatever, then redirects to post.php?action=edit&post=0 which in turn tries to find a post with the ID of 0 (which of course doesn't exist), so that error is spit out.

I'm pretty sure they are unrelated.

BoltClock7 years ago

The patch

comment:3 BoltClock7 years ago

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

comment:4 ryan7 years ago

BoltClock, that didn't fix it for me.

Viper007Bond, 2.2 has the same behavior. post.php?action=edit&post=0 when post title and content are empty.

comment:5 ryan7 years ago

wp_insert_post() returns a 0 to wp_write_post() if the post has no content or title. Perhaps we need to check for this and return WP_Error.

ryan7 years ago

comment:6 westi7 years ago

  • Keywords tested dev-reviewed commit added; needs-testing removed

+1 to rboren's patch

Tested and works fine for me

PHP 5.2.4_pre200708051230-pl2-gentoo with Suhosin-Patch 0.9.6.2

comment:7 ryan7 years ago

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

(In [5967]) Redirect back to post-new.php when doing a save and continue with empty post fields. fixes #4855

Note: See TracTickets for help on using tickets.