[Plugin: Yet Another Related Posts Plugin] SQL error in log after update to latest version YARRP
After I upgraded to the latest version of your plugin, I started seeing the following error in my logs – it seems to happen sporadically upon saving posts in the admin…
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘>= 1 order by score desc limit 12) union (SELECT 28069 as reference_ID, ID, ROUN’ at line 5 for query insert into wp_yarpp_related_cache (reference_ID,ID,score) (SELECT 28069 as reference_ID, ID, ROUND(0,1) as score
where post_status in ( ‘publish’, ‘static’ ) and ID != ‘28069’ and post_password =” and post_type = ‘post’
group by ID
having score >= 1.00 and >= 1 order by score desc limit 12) union (SELECT 28069 as reference_ID, ID, ROUND(0,1) as score
where post_status in ( ‘publish’, ‘static’ ) and ID != ‘28069’ and post_password =” and post_type = ‘page’
group by ID
having score >= 1.00 and >= 1 order by score desc limit 12) on duplicate key update date = now() made by require, require_once, include, related_posts, yarpp_related, YARPP->display_related, YARPP_Cache->enforce, YARPP_Cache_Tables->update
Thank you so much for bringing this to my attention! This was a bug in 3.4.x that would happen when you required that a certain number of categories or tags were in common, but that post doesn’t have any categories or tags.
I just released 3.4.4b2 which I believe addresses this issue. After installing 3.4.4b2, please go to the YARPP options and make sure the “relatedness” criteria is the same as before. There was a slight migration in the internal options values, and I want to make sure that your settings are copied over correctly. Thanks!
Cool. Thanks for the reply – I’ll definitely install the update and let you know if the problem goes away.
So maybe I’m looking in the wrong place, but I don’t see the relatedness criteria anywhere in the options screen. I see “Order results” but that’s it. I didn’t see them under the last version either, but I know I saw them several versions back.
I’m using a custom template file for both the website and rss feed if that helps.
@technabob they were hidden starting in version 3.3 to simplify the options. If you go to “screen options” at the top of the screen, you can make them visible again.
Got it. Thanks. I’m actually not sure if I lost any of my settings, as I don’t recall how I had them set. I thought I had it considering both tags and titles before, but I only see that it’s using tags now. I just added title to the criteria and that’s the way I want it anyhow.
The good news is that the errors are now gone from the logs.
Thanks again for your help – and a great plugin.
- The topic ‘[Plugin: Yet Another Related Posts Plugin] SQL error in log after update to latest version YARRP’ is closed to new replies.