Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#53135 closed defect (bug) (duplicate)

PHP Warning: Attempt to read property in class-wp-query.php

Reported by: bwbama's profile bwbama Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.7.1
Component: Query Keywords: reporter-feedback
Focuses: Cc:

Description

My error log is filled with these errors and I am having a hard time trying to figure out what might be triggering it.

[03-May-2021 01:11:31 UTC] PHP Warning: Attempt to read property "ID" on null in /home/nginx/domains/bamapolitics.com/public/wp-includes/class-wp-query.php on line 4044
[03-May-2021 01:11:31 UTC] PHP Warning: Attempt to read property "post_title" on null in /home/nginx/domains/bamapolitics.com/public/wp-includes/class-wp-query.php on line 4046
[03-May-2021 01:11:31 UTC] PHP Warning: Attempt to read property "post_name" on null in /home/nginx/domains/bamapolitics.com/public/wp-includes/class-wp-query.php on line 4048

Should there not be some checking to make sure that the property is not null?

Server is running PHP 8.0.5

Change History (2)

#1 @Hareesh Pillai
3 years ago

  • Keywords reporter-feedback added

Hi @bwbama,
Welcome to WordPress trac.

To debug this issue, would you be able to disable all the plugins and change to a default theme (say, Twenty Twenty One) and confirm if you still see the warning in the error log?

#2 @SergeyBiryukov
3 years ago

  • Component changed from General to Query
  • 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.