diff --git a/date_views/date_views.module b/date_views/date_views.module index 6f9dd833da7202dbe3a9332ffcb095b780f75ecb..3c91c6fbdd8a1f38cc4421130680a8c4df02e8f4 100644 --- a/date_views/date_views.module +++ b/date_views/date_views.module @@ -218,9 +218,11 @@ function date_views_field_views_data_alter(&$result, $field, $module) { foreach ($data as $column => $value) { if (array_key_exists('argument', $value)) { $result[$table][$column]['argument']['handler'] = 'date_views_argument_handler_simple'; + $result[$table][$column]['argument']['empty field name'] = t('Undated'); } if (array_key_exists('filter', $value)) { $result[$table][$column]['filter']['handler'] = 'date_views_filter_handler_simple'; + $result[$table][$column]['argument']['empty field name'] = t('Undated'); } // The old 'entity_id' and 'revision_id' values got rewritten in Views. // The old values are still there with a 'moved to' key, so ignore them. diff --git a/date_views/includes/date_views_argument_handler.inc b/date_views/includes/date_views_argument_handler.inc index 230786f367cbfc6f6603500f5c4dd4bcc4296fea..8430ce94738fcf0989a56bf1237924fa5d5a3413 100644 --- a/date_views/includes/date_views_argument_handler.inc +++ b/date_views/includes/date_views_argument_handler.inc @@ -132,16 +132,6 @@ class date_views_argument_handler extends date_views_argument_handler_simple { } } - /** - * Provide a link to the next level of the view from the summary. - */ - function summary_name($data) { - $format = $this->date_handler->views_formats($this->options['granularity'], 'display'); - $value = $data->{$this->name_alias}; - $range = $this->date_handler->arg_range($value); - return date_format_date($range[0], 'custom', $format); - } - /** * Provide the argument to use to link from the summary to the next level; * this will be called once per row of a summary, and used as part of diff --git a/date_views/includes/date_views_argument_handler_simple.inc b/date_views/includes/date_views_argument_handler_simple.inc index 2ef39fec9a4340d8004fbc9a8f1df768c95eb9b2..f2d9002a71e3af96dd81118b758cb9fb795fdf4b 100644 --- a/date_views/includes/date_views_argument_handler_simple.inc +++ b/date_views/includes/date_views_argument_handler_simple.inc @@ -32,9 +32,12 @@ class date_views_argument_handler_simple extends views_handler_argument_date { $this->date_handler->granularity = $this->options['granularity']; // Set up the formula for this field. - $this->arg_format = $this->date_handler->views_formats($this->date_handler->granularity, 'display'); + $this->format = $this->date_handler->views_formats($this->date_handler->granularity, 'display'); + $this->arg_format = $this->date_handler->views_formats($this->date_handler->granularity, 'sql'); $this->sql_format = $this->date_handler->views_formats($this->date_handler->granularity, 'sql'); $this->formula = $this->date_handler->sql_format($this->sql_format, $this->date_handler->sql_field("***table***.$this->real_field")); + + $this->definition['empty field name'] = t('Undated'); } /** @@ -79,4 +82,22 @@ class date_views_argument_handler_simple extends views_handler_argument_date { form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9')); } } + + /** + * Provide a link to the next level of the view from the summary. + */ + function summary_name($data) { + $value = $data->{$this->name_alias}; + if (empty($value) && !empty($this->definition['empty field name'])) { + return $this->definition['empty field name']; + } + $format = $this->date_handler->views_formats($this->options['granularity'], 'display'); + $range = $this->date_handler->arg_range($value); + return date_format_date($range[0], 'custom', $format); + } + + + + + }