Problem/Motivation
The delta option on filters in Views does not work for end dates. Setting "Add multiple value identifier" to "Yes" simply does not do anything.
A few hours of debugging shows that the problem is caused by the way $real_field_name
is calculated when setting the id and delta fields on the Views query object. Instead of stripping '_value2' it only strips '_value', thus leaving '2'.
Proposed resolution
The solution is quite simple as per the attached patch.
- $real_field_name = str_replace(array('_value', '_value2'), '', $this->real_field);
+ $real_field_name = str_replace(array('_value2', '_value'), '', $this->real_field);
Remaining tasks
- Apply patch
- ???
- Profit!
Comment | File | Size | Author |
---|---|---|---|
#3 | delta_option_on_views-1842730-3.patch | 2.66 KB | Valentine94 |
Comments
Comment #1
Valentine94Bot
Comment #3
Valentine94Re-roll.
Comment #4
Valentine94Comment #5
andypostComment #6
anpolimusHi, @yosh.
Is it possible to provide us view export for better testing?
Comment #7
anpolimusComment #8
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 4 year old patch in #3 to date_views_argument_handler_simple.inc and date_views_filter_handler_simple.inc still applies cleanly to 7.x-2.x-dev and seems like a reasonable/necessary fix to me.