#56188 closed defect (bug) (duplicate)
Attempt to read property "post_type" on null after PHP 8.1
| Reported by: | brmartinez | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | |
| Severity: | critical | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description (last modified by )
Hello, I've noticed this error in WordPress since I've installed PHP 8.1. Can you fix it?
[09-Jul-2022 16:16:45 UTC] PHP Warning: Attempt to read property "post_type" on null in /.../wp-includes/class-wp-query.php on line 4338
Change History (7)
This ticket was mentioned in PR #3142 on WordPress/wordpress-develop by Tabrisrp.
4 years ago
#1
- Keywords has-patch added; needs-patch removed
#6
@
18 months ago
- Description modified (diff)
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
@mukesh27 commented on PR #3142:
7 weeks ago
#7
Thanks for the PR, @remyperona!
This appears to have been addressed in r54496 and Ticket 56188 marked as duplicate of 29660, which already landed. Closing this PR as resolved.
If I've missed something this PR covers that the committed fix doesn't, please reopen or comment on the ticket. Happy to take another look
get_queried_object()can returnnull, but there was no check for its value before trying to read thepost_typeproperty from the value.Trac ticket: https://core.trac.wordpress.org/ticket/56188