Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
For example if a contrib module removes an exposed filter then there will be no date value, however a where expression is still added to the query, I'd like to suggest that if there is no value the expression is not added.
Comment | File | Size | Author |
---|
Comments
Comment #2
MustangGB CreditAttribution: MustangGB commentedHad problems with
empty()
so changed tois_null()
instead.Comment #3
MustangGB CreditAttribution: MustangGB commentedOkay think I've got this figured out now, back on empty(), but now testing whether filters are exposed before using exposed/session values, which happens when you had exposed filters, however then another module (e.g. views_dependent_filters) hides/removes them.
Comment #4
MustangGB CreditAttribution: MustangGB commentedSo the behaviour of #3 is:
a) Filter not exposed -> Query added with default value
b) Filter exposed -> Query added with filter value
c) Filter exposed then removed -> Query added with default value
I think in the instance of (c) the intention is that the default value is used as the default value of the exposed filter only, and if the filter is removed then the filter/default value should be ignored completely.
So the behaviour of #4 is (changes in bold):
a) Filter not exposed -> Query added with default value
b) Filter exposed -> Query added with filter value
c) Filter exposed then removed -> Query not added
Comment #5
MustangGB CreditAttribution: MustangGB commentedLatest version.
Comment #6
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 2 year old patch in #5 to date_views_filter_handler_simple.inc does not apply to the latest 7.x-2.x-dev and will need to be rerolled.