Community Forums

ATutor Bug Reports

1.6.2: forum search not working?


You must be signed-in to post.

AuthorSubject
 
Page: 1 | 2
vegard

Avatar for vegard
Subject: 1.6.2: forum search not working?Quote this post in your reply
hm, the search are not returning any results from the forums on my installs, but it does seem to work at your demo server..? have tried with default theme as well.

anyone else having trouble with this? results from content are returned as usual..
Posted: 2009-01-20 08:51:06
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
Hmm, did you try applying patch 0004 and 0005?
Posted: 2009-01-20 10:09:37
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
yes, all patches applied.
Posted: 2009-01-21 06:09:53
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
Which MySQL version is this?
Posted: 2009-01-22 09:21:03
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
two different ones:

versions of php - 4.3.9 and 5.2.3
version of mysq l - 4.1.22 and 5.0.37
Posted: 2009-01-22 09:34:52
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
you can see it here:

atutor.no/atutor/go.php/democourse/index.php

this is the server with the newest php / mysql
Posted: 2009-01-22 09:38:05
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
That's werid..
I can't seem to reproduce this problem on my machine.

Can you open up include/lib/search.inc.php and go to line 180~196. All the queries should be using TABLE_PREFIX. Before patch 4, and 5, I typed it as AT_, and will cause a problem. Can you please verify if the corrections have been made? Thanks
Posted: 2009-01-22 09:57:30
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
seems right, here's line 175 - 200

highlight_code('
//forums sql
// Wants to get course forums + "my" group forums
//if the search is performed outside of a course, do not search in any group forums
// UNION on course_forums and group_forums
// TODO: Simplify the query.
((isset($_SESSION['is_admin']) && $_SESSION['is_admin'] > 0) ? $is_admin_string = '1 OR ' : $is_admin_string = '');
(isset($_SESSION['member_id']) ? $member_id = $_SESSION['member_id'] : $member_id = 0);
$sql = 'SELECT course_group_forums.title AS forum_title, course_group_forums.course_id, T.* FROM '.TABLE_PREFIX.'forums_threads T RIGHT JOIN ';

//course forums
$sql .= '( SELECT forum_id, course_id, title, description, num_topics, num_posts, last_post, mins_to_edit FROM '.TABLE_PREFIX.'forums_courses ';
$sql .= ' NATURAL JOIN '.TABLE_PREFIX.'forums WHERE course_id='.$course_id;

$sql .= ' UNION ';

//group forums
$sql .= ' SELECT forum_id, course_id, title, description, num_topics, num_posts, last_post, mins_to_edit FROM '.TABLE_PREFIX.'forums_groups NATURAL JOIN ';
$sql .= ' (SELECT forum_id, num_topics, num_posts, last_post, mins_to_edit FROM '.TABLE_PREFIX.'forums) AS f NATURAL JOIN ';
$sql .= ' '.TABLE_PREFIX.'groups_members NATURAL JOIN ';
$sql .= ' (SELECT g.*, gt.course_id FROM '.TABLE_PREFIX.'groups g INNER JOIN '.TABLE_PREFIX.'groups_types gt USING (type_id) WHERE ';
$sql .= ' course_id='.$course_id.') AS group_course WHERE '.$is_admin_string .'member_id='.$member_id;

$sql .= ') AS course_group_forums ';

$sql .= 'USING (forum_id) ';
$sql .= 'WHERE ' . $words_sql;')
Posted: 2009-01-23 07:14:08
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
It doesn't work on all of your systems?
Posted: 2009-01-23 09:25:25
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
correct, neither in our production server (old php & db) or at atutor.no (new php & db) - I can see that it works on your demo server, so I have no idea why..
Posted: 2009-01-23 09:31:05
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
If possible, can you send your test server's database dump to my email please?

Thanks! if not, we will figure out another way to debug this.
Posted: 2009-01-23 10:34:12
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
sure, it's in the mail!
Posted: 2009-01-26 03:54:35
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
I am thinking this is probably related to this thread:
www.atutor.ca/view/3/16346/1.html, or
www.atutor.ca/view/3/16290/1.html
Posted: 2009-02-06 16:29:10
vegard

Avatar for vegard
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
you're probably right Harris, and I believe I've found the source now too!

this is related to the use of numbers (or other charachters?) in the table prefixes.

I now have two identical installs at my localhost, one with the default AT_ table prefix, one with AT_162_ as prefix, and forum search only returns results from the one with the AT_ prefix.

(explains atutor.no and my production server too, both have numbers in the prefix)
Posted: 2009-02-12 04:56:14
harris

Avatar for harris
Subject: Re: 1.6.2: forum search not working?Quote this post in your reply
Do those 2 installation have patch 0004 and 0005 applied? The table prefix problem should had been fixed with those patches.
Posted: 2009-02-12 09:28:01
 
Page: 1 | 2

You must be signed-in to post.

Related Articles