Opened 4 years ago
Closed 8 months ago
#56188 closed defect (bug) (duplicate)
Attempt to read property "post_type" on null after PHP 8.1
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | critical | Version: | |
| Component: | Posts, Post Types | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
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 (6)
This ticket was mentioned in PR #3142 on WordPress/wordpress-develop by Tabrisrp.
3 years ago
#1
- Keywords has-patch added; needs-patch removed
Note: See
TracTickets for help on using
tickets.
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