Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
When comparing both start and end values with the use_fromto
in date_views_argument_handler_simple
The following SQL is generated:
(DATE_FORMAT(field_data_field_date.field_date_value2, '%Y-%m') >= '2017-08' AND DATE_FORMAT(field_data_field_date.field_date_value, '%Y-%m') <= '2017-08')
With this code:
$this->query->add_where_expression($group, "$field_max >= $view_min_placeholder AND $field_min <= $view_max_placeholder", array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max));
Proposal
(DATE_FORMAT(field_data_field_date.field_date_value, '%Y-%m') >= '2017-08' AND DATE_FORMAT(field_data_field_date.field_date_value2, '%Y-%m') <= '2017-08') )
$this->query->add_where_expression($group, "$field_min >= $view_min_placeholder AND $field_max <= $view_max_placeholder", array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max));
Comments
Comment #2
joelpittetNot totally sure on this yet... but it looks like a mistake, likely needs tests
Comment #3
joelpittetThis is likely a cause of calendar modules implementation of
calendar_date_default_argument_alter
withcalendar_track_date
turned on and non-discriminatory about which view it applies itself to.Comment #4
joelpittetActually, re-opening under the calendar module.