Commit eef1e4ae authored by David Lesieur's avatar David Lesieur

Avoid null dates from creeping in.

parent 67d03ee9
......@@ -160,6 +160,7 @@ class date_facet extends cck_facet {
$main_column = array_shift($db_info['columns']);
$query->add_table($db_info['table'], 'vid', 'n', 'vid');
$query->add_field(NULL, "YEAR(${db_info['table']}.${main_column['column']})", $this->_field['field_name'] .'_year');
$query->add_where($db_info['table'] .'.'. $main_column['column'] .' IS NOT NULL');
$query->add_groupby($this->_field['field_name'] .'_year');
return TRUE;
}
......@@ -355,6 +356,7 @@ class datestamp_facet extends date_facet {
$main_column = array_shift($db_info['columns']);
$query->add_table($db_info['table'], 'vid', 'n', 'vid');
$query->add_field(NULL, "YEAR(FROM_UNIXTIME(${db_info['table']}.${main_column['column']}))", $this->_field['field_name'] .'_year');
$query->add_where($db_info['table'] .'.'. $main_column['column'] .' IS NOT NULL');
$query->add_groupby($this->_field['field_name'] .'_year');
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment