I can’t get any results to show up since upgrading from 1.8.4 to 1.9.0 packaged with my MODx 1.0.4 upgrade.
When I type in a search term, I’m getting a js error in my firebug panel:
invalid regular expression flag h
line 25: /assets/snippets/ajaxSearch/js/ajaxSearch1/ajaxSearch-jquery.js
If I inspect the post response from the search it shows a php error in the results
<br />
<b>Warning</b>: mb_convert_encoding() [<a href='function.mb-convert-encoding'>function.mb-convert-encoding</a>]: Illegal character encoding specified in <b>/home/tresilli/public_html/assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php</b> on line <b>238</b><br />
{"res":" <p class=\"AS_ajax_resultsInfos\">1 result found for \"<span class=\"ajaxSearch_highlight ajaxSearch_highlight1\">career</span>\".<span class=\"AS_ajax_resultsDisplayed\">Displayed: 1</span></p> <div id=\"grpResult_site_wide\" class=\"AS_ajax_grpResult\"> <div class=\"AS_ajax_grpResultName\"> <span class=\"ajaxSearch_grpResultsDisplayed\">(Displaying 1 - 1 of 1)</span></div> <div class=\"AS_ajax_result\"> <a class=\"AS_ajax_resultLink\" href=\"/recruitment/why-a-career.html?searched=career&advsearch=oneword&highlight=ajaxSearch_highlight+ajaxSearch_highlight1\" title=\"Why work \">Why work with Us</a> <div class=\"AS_ajax_resultExtract\"><p>... We offer a unique <span class=\"ajaxSearch_highlight ajaxSearch_highlight1\">career</span> path in child and family health. Our Centres are located in excellent locations around ...</p></div> </div> <div class=\"paging1\"> <span class=\"paging1Infos\"> 1 - 1 / 1 </span> </div> </div> ","resnb":"1,1","ctgnm":"[\'site_wide\']","ctgnb":"[1]"}
So it looks like some results are coming through, but they are not being displayed because theres some characters in there that the javascript parsing routine cant handle, most likely from the php generated warning. I’m not sure where to go from here. The line the php error refers to in ajaxSearchOutput.class.inc.php is:
if ($this->_needsConvert) $outputResults = mb_convert_encoding($outputResults,"UTF-8",$this->pgCharset);
Does this mean that the php function with that encoding is not available on my server?
Here is my current ajaxsearch call - i already load the jquery library 1.4.2 earlier in the page:
[!AjaxSearch? &showIntro=`0` &jscript=`jquery` &addJscript=`0` !]
AJAXSEARCH 1.9.0
MODX 1.0.4
PHP 5.2.13
LINUX/APACHE