We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Urgent : Inconsistent forum search result after upgrade to ee 2.2.1 and forum : 3.1.5.

Development and Programming

Gurudutt Verma's avatar
Gurudutt Verma
74 posts
14 years ago
Gurudutt Verma's avatar Gurudutt Verma

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.

       
Gurudutt Verma's avatar
Gurudutt Verma
74 posts
14 years ago
Gurudutt Verma's avatar Gurudutt Verma

Reported :

https://support.ellislab.com/bugs/detail/16200/

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.