WordPress.org

Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#24246 closed defect (bug) (fixed)

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

Reported by: johnbillion Owned by: 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 12 months ago.
24246.2.patch (4.3 KB) - added by SergeyBiryukov 12 months ago.

Download all attachments as: .zip

Change History (9)

johnbillion12 months ago

comment:1 johnbillion12 months ago

  • Keywords i18n-change added

Patch.

comment:2 johnbillion12 months 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.

comment:3 ocean9012 months ago

  • Keywords has-patch added; i18n-change removed

comment:4 ocean9012 months 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

SergeyBiryukov12 months ago

comment:5 SergeyBiryukov12 months 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.

comment:6 SergeyBiryukov12 months ago

  • Milestone changed from Awaiting Review to 3.6

comment:7 SergeyBiryukov12 months ago

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