Rss 2.0 via FEED
Ken Hughes... - SupportSuite - KB bug fixed
Productivity, Technology and Automating Everything...
    
 

I found an issue in SupportSuite (3.0.0.32) where if a client (user) did a KB search they would get the subject line and first 255 characters of each result match - some of these matches would be PRIVATE or DRAFT knowledgebase articles.

I guess this is a bug, but based on the responses (timeframe to even review reported issues) to bugs I reported to Kayako recently, I decided to fix it myself...

Here is what I did :

MODIFIED /modules/core/client_search.php
In the section commented as : // ===== SEARCH ALL MODULES ======== CHANGED if ($module->isRegistered(MODULE_KNOWLEDGEBASE)) { $_searchresults = searchKnowledgebase($_POST["searchquery"]); } TO if ($module->isRegistered(MODULE_KNOWLEDGEBASE)) { $_searchresults = searchClientKnowledgebase($_POST["searchquery"]); } also in the else if block directly below : CHANGE } else if ($_POST["searchtype"] == "knowledgebase" && $module->isRegistered(MODULE_KNOWLEDGEBASE)) { $_searchresults = searchKnowledgebase($_POST["searchquery"]); TO } else if ($_POST["searchtype"] == "knowledgebase" && $module->isRegistered(MODULE_KNOWLEDGEBASE)) { $_searchresults = searchClientKnowledgebase($_POST["searchquery"]); So, you've now forced the client search functions to use a new function (called seachClientKnowledgebase)
that we will now define...
  • Open the file /modules/core/functions_clientsearch.php
  • Copy the whole function named searchKnowledgebase and paste another copy into the same file.
  • Now rename the function to searchClientKnowledgebase.
In the newly pasted and renamed function look for the section starting with // ========BUILD THE CATEGORY LIST FOR THIS GROUP ===== ADD // KH get the status of each article and only use the 'published' ones $_finalpublishedarticlelist = array(); $dbCore->query("SELECT * FROM `". TABLE_PREFIX ."kbarticles` WHERE
(line wrapped) kbarticleid IN (". buildIN($_finalkbarticleidlist) .");"); while ($dbCore->nextRecord()) { if ($dbCore->Record["articlestatus"] == "published") { $_finalpublishedarticlelist[] = $dbCore->Record["kbarticleid"]; } }
DIRECTLY AFTER while ($dbCore->nextRecord()) { if ($dbCore->Record["categorytype"] == SWIFTPUBLIC) { $_finalkbarticleidlist[] = $dbCore->Record["kbarticleid"]; } } Then modify the next block of code to read as follows : if (!count($_finalpublishedarticlelist)) { return $_queryresult; }

Alternatively simply make a backup of your existing files :

  • /modules/core/functions_clientsearch.php
  • /modules/core/client_search.php
and replace them with the files in php_mods.zip
Posted: Friday, April 21, 2006 12:48:34 AM (GMT Daylight Time, UTC+01:00)  #   Comments [0]
TAGS: PHP | Scripting | Technical
All comments require the approval of the site owner before being displayed.
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview
     
 
 
Copyright © 2008 Ken Hughes. All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.