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.087 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started