Open adumont-tokilab opened 4 months ago
Two additional Cases
Could not be only related to Yoast, but also to other 3rd parties calling clean_post_cache
https://secure.helpscout.net/conversation/2656511889/503466 (not using Yoast) https://secure.helpscout.net/conversation/2661231689/504375
related slack thread with more details: https://wp-media.slack.com/archives/C43T1AYMQ/p1721925394744229
Describe the bug A notice is thrown when saving a post when Yoast is installed and if that post exists in the "wpr_above_the_fold" table. In fact, WordPress calls the method "clean_post_cache" once on save. WP-Rocket cleans the URL of that post from the "wpr_above_the_fold" table. Later on, Yoast also calls "clean_post_cache", which triggers the same hook that WP-Rocket uses but fails because the database entry doesn't exists anymore. WP-Rocket caches the database results. The first time they are used, it is okay but the second time, it returns an array of elements but those elements equals "false".
Notice: Trying to get property 'id' of non-object in /web/app/plugins/wp-rocket/inc/Engine/Common/Database/Queries/AbstractQuery.php on line 402
To Reproduce Steps to reproduce the behavior:
Expected behavior The post should be saved without throwing a notice.