Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#24246 closed defect (bug) (fixed)

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

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

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 11 years ago.
24246.2.patch (4.3 KB) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (9)

@johnbillion
11 years ago

#1 @johnbillion
11 years ago

  • Keywords i18n-change added

Patch.

#2 @johnbillion
11 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
11 years ago

  • Keywords has-patch added; i18n-change removed

#4 @ocean90
11 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
11 years ago

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

In 24201:

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

#6 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.6

#7 @SergeyBiryukov
11 years ago

  • Version changed from trunk to 3.0
Note: See TracTickets for help on using tickets.