Opened 11 years ago
Last modified 4 months ago
#31199 accepted defect (bug)
Potential reference to unset variable in get_bulk_actions (WP_Posts_List_Table)
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch reporter-feedback close |
| Focuses: | Cc: |
Description
get_post_type_object can return null in some cases, which causes a notice when current_user_can is called later in the function.
Attached a patch to check if delete_posts is set, and to only add actions if it is. Thanks!
Attachments (3)
Change History (9)
#1
@
11 years ago
- Keywords has-patch added
Hi sgrant
Could you please provide a the way you have triggered this bug, so that I can reproduce it ?
And I think you made a mistake in your patch : $post_type_obj->delete_posts will never exist, its $post_type_obj->cap->delete_posts that has to be checked.
#3
@
7 years ago
- Keywords reporter-feedback removed
- Milestone changed from Awaiting Review to 5.1
- Owner set to chriscct7
- Status changed from new to accepted
Updated patch with additional checks for edit_posts cap as well as empty post_type_obj variable.
#4
@
7 years ago
- Milestone changed from 5.1 to Future Release
It'd be good to have some steps to reproduce this.
#6
@
4 months ago
- Keywords close added
Hi @sgrant,
As we haven't seen any progress on this regarding steps to recreate the problem, I'm applying the close tag.
Feel free to respond and remove it if you'd prefer to keep the discussion going. For example, you might try installing the Test Reports plugin and submitting a bug report. This will help us pinpoint any external factors contributing to the issue, allowing the community and me to offer more effective assistance. 😃
Add isset check before referencing