I actually got this working with minimal hacking
First in the model XML file I chanfed the filter type
This
<field name="filter_genres"
listKey="id"
labelKey="genre"
type="ckcombo"
nullLabel="COMPONENT_FILTER_NULL_FILTER_GENRE"
class="span-2 element-filter"
label="COMPONENT_JSEARCH_FILTER_BY_GENRE"
ui="chosen"/>
became this
<field name="filter_genres"
type="relation"
submit="true"
placeholder="COMPONENT_FILTER_NULL_FILTER_GENRE"
label="COMPONENT_JSEARCH_FILTER_BY_GENRE"
class="element-filter"
ui="chosen"
filter="array"
multiple="true"
relation="genres"
labelKey="genre"/>
I altered the WHERE statement in the prepareQuery from
This
//WHERE - FILTER : Genre
if($filter_genres = $this->getState('filter.genres'))
{
if ($filter_genres > 0){
$this->addWhere("a.genres IN (" . (int)$filter_genres . ")");
}
}
to this
//WHERE - FILTER : Genre
if($filter_genres = $this->getState('filter.genres'))
{
if (count($filter_genres) > 1 || (count($filter_genres) == 1 && array_sum($filter_genres) > 0)){
$string = ltrim(implode(',', $filter_genres), ',');
$this->addWhere("a.genres IN (" . $string . ")");
}
}
for some reason after one search, the array kept passing a null value which messed it up so I had to look for the null value and ignore
And in the same model file in the __construct function I changed this
$this->set('filter_vars', array(
'genres' => 'cmd',
to this
$this->set('filter_vars', array(
'genres' => 'array',
uploaded and it seems to do the trick