I have altered the following code in my view.php.html file to filter the contents of a select box
From
$model_second_line_grp = CkJModel::getInstance('Oncallareas', 'RtcalloutModel');
$model_second_line_grp->addGroupOrder("a.area");
$lists['fk']['second_line_grp'] = $model_second_line_grp->getItems();
to
$model_second_line_grp = CkJModel::getInstance('Oncallareas', 'RtcalloutModel');
$model_second_line_grp->addWhere("a.second_line=1");
$model_second_line_grp->addGroupOrder("a.area");
$lists['fk']['second_line_grp'] = $model_second_line_grp->getItems();
I have tried this change in both a FORK and in the core file. However the SELECT box is not applying the WHERE statement
When I look at DEBUG mode, I see that the query has been created (and checks out in MYSQL with the correctly filtered results) but there is ALSO a query for selecting every single record. It is this unfiltered list that appears to be applying to my dropdown i.e query 15 and not 17 in the debugging
Here are the queries
15 -
SELECT a.id,a.created_by,a.published,a.*
FROM p17oj_rtcallout_oncallparents AS a
WHERE (a.created_by = 40 OR 1)
AND (a.published = 0 OR a.published = 1 OR a.published IS NULL)
ORDER BY a.name,a.ordering asc
17 -
SELECT a.id,a.created_by,a.published,a.*
FROM p17oj_rtcallout_oncallareas AS a
WHERE (a.created_by = 40 OR 1)
AND (a.published = 0 OR a.published = 1 OR a.published IS NULL)
AND a.second_line=1
ORDER BY a.area,a.ordering asc
Looking in the view php file, I can see that the results are being called for second_line_grp, but wondering if the ajax is just pulling in the default list