Welcome, Guest
Username: Password: Remember me

TOPIC: [CLOSED] Some filters not working in ORM

Some filters not working in ORM 29 Dec 2016 22:17 #14880

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 296
  • Thank you received: 41
  • Karma: 21
Hello Admin / cooks

Please note that range filters are working in ORM; however, fk filters aren't being rendered in the prepareQuery function and therefore not working on the forms.
	'filter' => array(
		'creation_date' => array(
			'type' => 'range'
		),
		'modification_date' => array(
			'type' => 'range'
		),
	),

You may want to add something like this for "cmd" filters until Admin can update the code.
	'user_id' => array(
		'type' => 'fk'
	),

Warm regards
vlemos


BTW: the ORM 3.1 code is bleeding through all the Builder versions I have tested. We all now live On the edge!
The administrator has disabled public write access.

Some filters not working in ORM 30 Dec 2016 10:37 #14881

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
The version problem is fixed, but for the filters can you be more precise please ?

For me, the range filters are created correctly.
And for 'cmd' filters, what do you mean exactly ?

The filters part was the most complex to achieve, due to the numerous strategies changes in time, this is becoming complex to handle past versions. And so the new code has been tested a lot.

The only limitations at the moment are :
- RANGE + FK (Not available yet)
- LIST + Enum
- ENUM + FK

Those limitation will be released very soon, just a matter of rewriting the fields. Because the model handles it, but not the XML Form.
It is on the way.

Anyways, about your problem, please furnish more details.
Coding is now a piece of cake
The administrator has disabled public write access.

Some filters not working in ORM 30 Dec 2016 15:22 #14883

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 296
  • Thank you received: 41
  • Karma: 21
The generated prepareQuery function now looks like this:
	/**
	* Preparation of the list query.
	*
	* @access	protected
	* @param	object	&$query	returns a filled query object.
	*
	* @return	void
	*/
	protected function prepareQuery(&$query)
	{
		//FROM : Main table
		$query->from('#__test_users AS a');

		// Automatic composition of the base query from ORM description
		$this->populateStatesOrm();

		$this->orm(array(
			'select' => array(
				'created_by',
				'published'
			),
			'access' => array(
				'a' => array(
					'publish' => 'published',
					'author' => 'created_by'
				)
			),
			'filter' => array(
				'creation_date' => array(
					'type' => 'range'
				),
				'modification_date' => array(
					'type' => 'range'
				)
			)
		));

		// Apply all SQL directives to the query
		$this->applySqlStates($query);
	}

However, the "created by" filter reloads the page but displays the same results as the previous selection. Only when:
	'created_by' => array(
		'type' => 'fk'
	),
is added to the filter array does the selection box change the displayed results.

The filter array would now look like:
	'filter' => array(
		'created_by' => array(
			'type' => 'fk'
		),
		'creation_date' => array(
			'type' => 'range'
		),
		'modification_date' => array(
			'type' => 'range'
		)
	)

and would work as expected
The administrator has disabled public write access.

Some filters not working in ORM 30 Dec 2016 15:43 #14884

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Oki. Gonna fix.
Coding is now a piece of cake
The administrator has disabled public write access.

Some filters not working in ORM 16 Jan 2017 23:12 #14949

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
You mean that the FK filter over a user is missing ?
For me it works and I din't changed anything.

Still this one for you ?
Are you sure for this issue report ?

It can be missing or deleted in the Builder and you are using a forked view and forked XML... (just for example)
If the filter is instanced correctly in the builder, there is no reason...

Are you sure in a fresh install that this filter is missing ?
Wich Project / Table / Layout in this case, so I can check yours.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.233 seconds

Get Started