Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Weird behaviour of Jmodel

Weird behaviour of Jmodel 29 Apr 2013 07:49 #7100

  • Tomaselli
  • Tomaselli's Avatar
  • Online
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
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();
Last Edit: 29 Apr 2013 07:49 by Tomaselli.
The administrator has disabled public write access.

Weird behaviour of Jmodel 11 Aug 2013 15:01 #10740

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This is fixed since 2.5.
Closed ticket.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.067 seconds

Get Started