Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 7 years ago

#4855 closed defect (bug) (fixed)

"Save and Continue Editing" is broken

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

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 19 years ago.
The patch
empty_post_redirect.diff (775 bytes ) - added by ryan 19 years ago.

Download all attachments as: .zip

Change History (10)

#1 @ryan
19 years ago

Due to [5875] for #4737 ?

#2 @Viper007Bond
19 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.

@BoltClock
19 years ago

The patch

#3 @BoltClock
19 years ago

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

#4 @ryan
19 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.

#5 @ryan
19 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.

#6 @westi
19 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

#7 @ryan
19 years ago

  • Resolutionfixed
  • Status newclosed

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

This ticket was mentioned in Slack in #core-editor by abdullahramzan. View the logs.


7 years ago

Note: See TracTickets for help on using tickets.