Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 5 years ago

#4855 closed defect (bug) (fixed)

"Save and Continue Editing" is broken

Reported by: viper007bond's profile 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 17 years ago.
The patch
empty_post_redirect.diff (775 bytes) - added by ryan 17 years ago.

Download all attachments as: .zip

Change History (10)

#1 @ryan
17 years ago

Due to [5875] for #4737 ?

#2 @Viper007Bond
17 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
17 years ago

The patch

#3 @BoltClock
17 years ago

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

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

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


5 years ago

Note: See TracTickets for help on using tickets.