Make WordPress Core

#56032 closed defect (bug) (duplicate)

PHP 8.1 has a flaw with WordPress 6.0 in class-wp-query.php

Reported by: internettim's profile InternetTim Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.0
Component: Query Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Updated some of the sites today to PHP 8.1, and instantly started to get error_logs, the exact ones, that read,

[22-Jun-2022 01:28:19 UTC] PHP Warning:  Attempt to read property "ID" on null in /home/username/public_html/wp-includes/class-wp-query.php on line 4186
[22-Jun-2022 01:28:19 UTC] PHP Warning:  Attempt to read property "post_title" on null in /home/username/public_html/wp-includes/class-wp-query.php on line 4188
[22-Jun-2022 01:28:19 UTC] PHP Warning:  Attempt to read property "post_name" on null in /home/username/public_html/wp-includes/class-wp-query.php on line 4190

Don't know if this will help you with the next update, but I am giving it a shot.

Change History (1)

#1 @SergeyBiryukov
22 months ago

  • Component changed from General to Query
  • Description modified (diff)
  • Keywords needs-patch needs-copy-review removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #29660.

Note: See TracTickets for help on using tickets.