Hello,
here some weird behaviour I found. I don't know if it's my coding mistake, but I didn't make big changes on the jmodel.item / jmodel.list jcook classes. by the way....
component details:
- few tables and views with several ajax filters.
- some table has fields with the same name
scenario:
on an item form view, I have some ajax filters but the data is not retrieved correctly.
Bug:
the data is not retrived correctly because the STATE "filter.FIELDNAME" (the same used on both tables) remains persistent between different models. (I know it's weird)
quick and dirty workaround (before a definitive solution):
simply clear the STATE "filter.FIELDNAME" before to call $model->getItem() or $model->getItems()
example:
$model = JModel::getInstance('items', 'ComponentModel');
// I remove all the filters variables for this model
$filter_vars = $model->get('filter_vars');
foreach($filter_vars as $f_varName => $type){
$model->setState('filter.'.$f_varName, null);
}
$items = $model->getItems();