#27446 closed defect (bug) (fixed)
PHP notice for media attached to no more registered post type
Reported by: | afercia | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.7 |
Component: | Media | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
This is a follow-up to #22312.
as far as I see, #22312 fixed this when users delete a post but I still can see PHP notices in one scenario.
I've just tested on 3.9-beta1-27528 and used this plugin:
Animate Slider
to reproduce:
- install the plugin
- create a new 'Slider' CPT
- insert an image in the body of the post, I mean don't create a real slider but just attach an image as you would do in a standard post
- save the post
- don't delete the post, deactivate the plugin instead and doing so you've just unregistered the 'Slider' CPT
- go in your media library
- next to the image you used in your 'Slider' you will see those PHP notices
I suppose that's because #22312 patch checks for the attachment parent post existence and it still does exist but it's no more a registered post type so get_post_type_object() checks that CPT in the global $wp_post_types, can't find it and returns null
Attachments (1)
Change History (5)
#1
@
11 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
- Version changed from trunk to 3.7
#2
@
10 years ago
- Keywords has-patch commit added
- Milestone set to 4.0
- Resolution duplicate deleted
- Status changed from closed to reopened
I thought this was fixed in [27560], apparently not.
27446.patch fixes this for WP_Media_List_Table
and synchronizes the edit_post
capability check between the list table and the media grid.
Note: See
TracTickets for help on using
tickets.
Duplicate of #27439.