Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#24246 closed defect (bug) (fixed)

PHP notices when attempting to delete/trash/untrash a deleted post

Reported by: johnbillion Owned by: SergeyBiryukov
Priority: low Milestone: 3.6
Component: Warnings/Notices Version: 3.0
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

If you attempt to delete, trash or untrash a post that has been deleted prior, WP will die with wp_die() but you'll get some notices too.

Attachments (2)

24246.patch (1.1 KB ) - added by johnbillion 13 years ago.
24246.2.patch (4.3 KB ) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (9)

@johnbillion
13 years ago

#1 @johnbillion
13 years ago

  • Keywords i18n-change added

Patch.

#2 @johnbillion
13 years ago

Example notice FYI:
Notice: Trying to get property of non-object in wp-admin\post.php on line 246
This refers to the $post_type_object variable which isn't an object when the post doesn't exist.

#3 @ocean90
13 years ago

  • Keywords has-patch added; i18n-change removed

#4 @ocean90
13 years ago

There is already a $post_type_object check for the edit action, see trunk/wp-admin/post.php:23929#L142, which we could use here too.

Related: #20064

#5 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 24201:

Avoid PHP notices when deleting or restoring an item that no longer exists. props johnbillion, ocean90. fixes #24246.

#6 @SergeyBiryukov
13 years ago

  • Milestone Awaiting Review3.6

#7 @SergeyBiryukov
13 years ago

  • Version trunk3.0
Note: See TracTickets for help on using tickets.