[patch] do not return all data when no tags are used to filter
I use tagpackprovider to filter my content by tags defined via $_GET parameters, so I have a
Tags from expressions:
vars:theme vars:domain vars:typeI have three use cases:
- default: no filtering, show all data
- search: filtering, show some data
- search failed: filtering, show no data
According to this, I use the following configuration for secondary provider:
- If filter empty: Display everything
- If secondary provider returns nothing: Display nothing (to show no data when search failed)
It seems to make sense however in default case it will show no results because tagpackprovider recognize there is no filter and wrongly assume it should return no data. Then according to the configuration the primary provider will return nothing. Basically Tagpackprovider confuse "not filtered" and "filtered but no result" and return same (empty) result in both cases.
The attached patch fix tagpackprovider behavior by returning all UID in case of not filtered.
#1 Updated by Francois Suter over 8 years ago
- Status changed from New to Needs Feedback
- Assignee set to Francois Suter
I would propose to add a flag similar to what exists for the relations between filters and providers: it would let the user choose what to do when the expressions were not empty, but the selection of tags returned nothing.
After that, rather than sending back all UIDs, which may potentially be a huge list, I would suggest introducing the \all keyword here too. This way we don't need to:
- get all the UIDs from the database
- match all those UIDs in the query that would receive such a condition
For example, in tx_dataquery_wrapper::addIdList(), we would just skip adding a IN condition if the value of the list is \all.
What do you think?
#8 Updated by Adrien Crivelli over 2 years ago
@François, could you please close this ticket ? I can't do it myself and we merged this patch a long time ago in our fork in https://github.com/Ecodev/tagpackprovider/commit/02f3cb27c55c96c91761a3dc0b0cca66d7f93d23