summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2011-12-28 17:13:12 (GMT)
committer Karen Stevenson2011-12-28 17:13:12 (GMT)
commitf1e4e053da4900b8b670ed68535ef15a595a8af5 (patch)
tree8053d7e378523cd295673a8826925dd30f274c75
parent2dca7fd6215a974f092bbbbf4360f6978fdcd042 (diff)
Our test for whether this is a Date argument or filter needs to include a check that the field was actually processed by Date Views. Some dates are not.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--date_views/date_views.module8
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index ad03e79..0dcd1f3 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -5,6 +5,7 @@ Date Module 7.x
Version 7.x-2.x-dev
===================
+- Our test for whether this is a Date argument or filter needs to include a check that the field was actually processed by Date Views. Some dates are not.
- Issue #1379172 by deviantpixel, Note that the Date Repeat form uses a function that was re-named in 7.8.
- Store the locale format in a static cache to avoid re-computing it dozens of times on calendar views.
- Sheesh. Fix syntax error in api.date.php.
diff --git a/date_views/date_views.module b/date_views/date_views.module
index 4734f58..d5ae1c9 100644
--- a/date_views/date_views.module
+++ b/date_views/date_views.module
@@ -284,13 +284,17 @@ function date_views_form_views_ui_edit_form_alter(&$form, &$form_state) {
* The instanceof function makes this work for any handler that was derived
* from 'views_handler_filter_date' or 'views_handler_argument_date',
* which includes core date fields like the node updated field.
+ *
+ * The test for $handler->min_date tells us that this is an argument that
+ * not only is derived from the views date handler but also has been processed
+ * by the Date Views filter or argument code.
*/
function date_views_handler_is_date($handler, $type = 'argument') {
switch ($type) {
case 'filter':
- return $handler instanceof views_handler_filter_date;
+ return $handler instanceof views_handler_filter_date && !empty($handler->min_date);
case 'argument':
- return $handler instanceof views_handler_argument_date;
+ return $handler instanceof views_handler_argument_date && !empty($handler->min_date);
}
return FALSE;
}