Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to read property "id" on bool [...] AbstractQueries.php on line 63 #6892

Closed
jas8522 opened this issue Aug 22, 2024 · 5 comments · Fixed by #7032
Closed

Attempt to read property "id" on bool [...] AbstractQueries.php on line 63 #6892

jas8522 opened this issue Aug 22, 2024 · 5 comments · Fixed by #7032
Assignees
Labels
priority: low Issues that can wait quick win severity: minor Defect that does not affect functionality type: bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@jas8522
Copy link

jas8522 commented Aug 22, 2024

Using 3.16.4, cron reports:

PHP Warning:  Attempt to read property "id" on bool in /wp-content/plugins/wp-rocket/inc/Engine/Common/PerformanceHints/Database/Queries/AbstractQueries.php](/wp-content/plugins/wp-rocket/inc/Engine/Common/PerformanceHints/Database/Queries/AbstractQueries.php) on line 63

Using PHP 8.1.

@piotrbak
Copy link
Contributor

Hello @jas8522 thanks for creating the issue. Could you contact our support team so we could check what's going on with your website?

If not, we'll need an exact steps to reproduce the issue. Please reopen the issue with steps, or after investigating we'll create a new one with instructions for developers.

@piotrbak piotrbak closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
@jas8522
Copy link
Author

jas8522 commented Sep 27, 2024

Do you have an idea how I can provide exact steps to reproduce when I only see the error in my email when cron runs? I get the exact same error repeated 15 times within the email. Happens once a day. There is no additional info in the cron report (except the part of the path to the web root that I removed for website anonymity).

Seems to me someone forgot to check if the $item value is set properly and line 63 should be wrapped with a check for that:

foreach ( $items as $item ) {
	if ( is_object($item) ){ 
	   $deleted = $deleted && $this->delete_item( $item->id );
	}
}

@piotrbak
Copy link
Contributor

@wp-media/engineering-plugin-team Would need your feedback here, should it be investigated further or the guard is just enough?

@jas8522 Thanks for your input

@piotrbak piotrbak reopened this Sep 30, 2024
@piotrbak piotrbak added type: bug Indicates an unexpected problem or unintended behavior priority: low Issues that can wait severity: minor Defect that does not affect functionality quick win labels Sep 30, 2024
@joejoe04
Copy link

@jas8522
Copy link
Author

jas8522 commented Oct 17, 2024

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Issues that can wait quick win severity: minor Defect that does not affect functionality type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants