Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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!

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
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

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Oki. Gonna fix.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.107 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started