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

  1. Apply patch
  2. ???
  3. Profit!
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Valentine94’s picture

Issue summary: View changes
Status: Patch (to be ported) » Needs review

Bot

Status: Needs review » Needs work

The last submitted patch, date_real_field_name.patch, failed testing.

Valentine94’s picture

Re-roll.

Valentine94’s picture

Status: Needs work » Needs review
andypost’s picture

Issue tags: +Needs tests
anpolimus’s picture

Hi, @yosh.
Is it possible to provide us view export for better testing?

anpolimus’s picture

Issue tags: +Needs manual testing
Chris Matthews’s picture

The 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.