SOLVED: Clear Filter in Content Plugin

Status
Not open for further replies.

keianrad

Member
I embedded a list base on client id, for example: app_tasks___client_id_raw=[rowid]
It shows everything well. But when I clear filters in the list, it shows all records that some of them are not belong to to current client based on [rowid].
It seems it doesn't filter that list based on [rowid] in content plugin after clearing filters.

Code:
<p><p>{fabrik view=list id=22 app_tasks___client_id_raw=[rowid] resetfilters=0 showfilters=1 fabrik_show_nav=1 limit=10 list-picker=0 }</p>
 
Last edited:
If you have a clear filter button in you list, it is the semantic of it to clear the filter and let the list show the unfiltered content. You can prevent to clear the filter by using a profilier for the list or you may configure not to show the filter items in your list.
 
Should be fixed as of this commit:

https://github.com/Fabrik/fabrik/commit/c4417ea27458db68cebbe3100e58b3058c76051f

@burghard - when you specify filters in a content plugin like that, they are supposed to be "sticky", and not get cleared by the Clear Filters button. This lets you use content plugin filters the same way you use menu pre-filters ... add extra base filtering to view of the list, which are sticky, and don't get cleared.

-- hugh
 
If you have a clear filter button in you list, it is the semantic of it to clear the filter and let the list show the unfiltered content. You can prevent to clear the filter by using a profilier for the list or you may configure not to show the filter items in your list.
I think that if you use a filter on a content imbed like this, it should act like a permanent pre-filter and not be removed when you clear filters as @keianrad is wanting - to do otherwise would be illogical and a security issue as it would open the list to displaying content that the author might not want to be seen. I would hope that making it work like a permanent pre-filter is what Hugh's commit does.
 
Yes, it should. as Hugh said the filter in content plugin should be sticky and not get cleared by the Clear Filters button. but it clears now when I click on the Clear Filters button.
 
@keianrad - have you updated from GitHub since Hugh's last comment?

If so, can you please load the Github link he shared and add a comment to tell him it hasn't worked.
 
Turned out to be a really nasty corner case, where you have multiple list plugins, and List A has "related data" to List B. When List A renders, it has to do a record count of List B, which runs buildQueryWhere() on List B, which loads all filters ... and was writing them out to the session ... which overwrites the session filter that List A creates when the content plugin applies the inline filter ... small change, just changed the filter "type" from 'jpluginfilter' to 'querystring' ... but that turns off the "sticky" ... so when List B does a clear filter, that inline filter is no longer sticky and gets cleared.

Fixed, by not writing out filters to the session when doing a record count on related lists.

https://github.com/Fabrik/fabrik/commit/29cd4aa34698e4c591533e780284f5752fdec317
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top