Hi
Forum search results are not consistent.
for e.g. active_topic_search forums/member_search/4 Or any other search in forum module display inconsistent search result.
If you see image, it should display 20 results on each page, but it displays very few, in fact it is inconsistent for each page.
Also sorting is not proper.
After digging in to forum module I found the bug and currently it is checking author_id and last_post_author_id from same members table, which is not possible in cross product query according to mysql guideline.
I have applied following patch to fix it.
--- mod.forum_core.php.orig 2011-07-13 16:48:35.000000000 +0200
+++ mod.forum_core.php 2011-07-13 17:41:58.000000000 +0200
@@ -9904,11 +9904,11 @@
t.status, t.sticky, t.thread_views,
t.topic_date, t.thread_total,
t.last_post_author_id, t.last_post_date,
- m.screen_name AS last_post_author,
+ n.screen_name AS last_post_author,
m.screen_name AS author')
- ->from(array('forum_topics t', 'members m'))
+ ->from(array('forum_topics t', 'members m','members n'))
->where_in('t.topic_id', array_unique($topic_ids))
- ->where('t.last_post_author_id = m.member_id')
+ ->where('t.last_post_author_id = n.member_id')
->where('m.member_id = t.author_id')
->where('t.announcement', 'n')
+ ->order_by('last_post_date','DESC')Also in mod.forum_core.php around line : 9852 sort_order is fetched
$sort_order = $query->row('sort_order');but it is not used in the query may be because it gets value “ORDER BY last_post_date desc” and it needs to be parsed in order to use it in the query as I have used it in my above patch.
I will report it as bug.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.