#1938 closed defect (bug) (fixed)
new "Fore index" sql clause conflicting with bbp_has_replies args !
Reported by: | villagora | Owned by: | |
---|---|---|---|
Milestone: | 2.1.3 | Priority: | highest omg sweet tea |
Severity: | blocker | Version: | 2.1 |
Component: | Component - Replies | Keywords: | |
Cc: | contact@… |
Description
Hi,
There is a mistake in _bbp_has_replies_where function. You can't change the where clause for add le "force index" like that.
Indeed, if like me, i want to pass args to bbp_has_replie function for make a meta query, a inner join is added to the query before the where clause (and so before the "force index" clause).
And in this case the sql query crash :
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) FORCE INDEX (PRIMARY, post_parent) WHERE 1=1 AND (wp_posts.ID = 125 OR wp_posts.post_parent = 125) AND wp_posts.post_type IN ('topic', 'reply') AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed') AND (wp_postmeta.meta_key = 'ratings_score' ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value DESC LIMIT 0, 15
#1064 - 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 'FORCE INDEX (PRIMARY, post_parent) WHERE 1=1 AND (wp_posts.ID = 125 OR wp_posts.' at line 1
I need a fix, thank you in advance !
Change History (5)
#4
@
12 years ago
Thank you JJJ ! :)
But, how can you fix it so that the topic should be displayed at the top of the same replies loop ?
#5
@
12 years ago
@villagora -- Were you able to fix this? If so, how?
I posted a topic on the bbPress Support Forums over 24 hours ago and have not received any help from users yet. (http://bbpress.org/forums/topic/topic-and-reply-content-not-displaying/)
I am unable to view any topic or reply content on the front end and would love to know how to fix this before I start exploring other forum options.
Duh. Confirmed, and this is pretty lame. Moving to 2.1.x milestone.