I'm using AdvSearch and it's great. However, I recently found that I'm getting the following error when performing a search. I do get results back though and it seems to work fine.
[2012-03-22 15:14:16] (ERROR @ xxxxx/public_html/core/components/advsearch/model/advsearch/advsearchresults.class.php : 588) PHP warning: array_multisort() [<a href='function.array-multisort'>function.array-multisort</a>]: Array sizes are inconsistent
These are my snippet calls:
[[!AdvSearchForm?
&searchIndex=`zoekterm`
&tpl=`AdvSearchFormFilters`
]]
[[!AdvSearch?
&hideContainers=`1`
&withFields=`pagetitle,introtext,content`
&withTVs=`straatEnNummer,belangrijkeInfo,categorieKeuze,leeftijdsgroepen,tags`
&fieldPotency=`pagetitle:50,introtext:30,tags:40,content:30`
&highlightTag=`strong`
&searchIndex=`zoekterm`
&engine=`mysql`
&queryHook=`zoekFilters`
&pagingType=`2`
&pagingSeparator=``
&showExtract=`1:introtext,content`
&ids=`[[!GetIds? &ids=`c133,c134,c135`]]`
]]
Chunk for the search form (AdvSearchFormFilters):
<form id="[[+asId]]_advsea-form" class="advsea-form searchFull" action="[[~[[+landing]]]]" method="[[+method]]">
<fieldset>
<input type="hidden" name="id" value="[[+landing]]" />
<input type="hidden" name="asId" value="[[+asId]]" />
<input type="text" id="[[+asId]]_advsea-search" name="[[+searchIndex]]" value="[[+searchValue]]" />
[[+liveSearch:isnot=`1`:then=`<input type="submit" id="[[+asId]]_advsea-submit" name="sub" value="Zoek" />`]]
<div class="zoekfilters">Zoek in:
<input type="radio" [[!zoekFilterChecked? &deel=`alles`]] value="alles" name="onderdeel" id="onderdeel_alles" /><label for="onderdeel_alles"> Alles</label>
<input type="radio" [[!zoekFilterChecked? &deel=`agenda`]] value="agenda" name="onderdeel" id="onderdeel_agenda" /><label for="onderdeel_agenda"> Agenda</label>
<input type="radio" [[!zoekFilterChecked? &deel=`aanbieders`]] value="aanbieders" name="onderdeel" id="onderdeel_aanbieders" /><label for="onderdeel_aanbieders"> Aanbieders</label>
<input type="radio" [[!zoekFilterChecked? &deel=`nieuws`]] value="nieuws" name="onderdeel" id="onderdeel_nieuws" /><label for="onderdeel_nieuws"> Nieuws</label>
</div>
</fieldset>
</form>
[[+resultsWindow]]
Queryhook snippet (zoekFilters):
$tag = 'onderdeel';
$area = (isset($_REQUEST[$tag])) ? strip_tags($_REQUEST[$tag]) : 'en';
// get the list of ids with GetIds
if ($area == 'agenda') {
$parent = '134';
} else if ($area == 'nieuws') {
$parent = '135';
} else if ($area == 'aanbieders') {
$parent = '133';
} else {
$parent = '0';
}
$ids = $modx->getChildIds($parent, 10); //get the array of ids of the children resources
$lstids = implode(',',$ids);
if ($area == 'agenda') {
$andConditions = array(
'modResource.id:IN' => $lstids . ':integer',
'link_attributes:>' => time()
);
} else {
$andConditions = array(
'modResource.id:IN' => $lstids . ':integer'
);
}
$qhDeclaration = array(
'qhVersion' => '1.1',
'andConditions' => $andConditions
);
$hook->setQueryHook($qhDeclaration);
return true;
Am I doing something wrong here that's producing the error message?
And another thing I noticed is that when using quotation marks in the search query ("") the search term is not placed in the input field of the search form.
Thanks for any help!