summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--handlers/views_handler_filter_in_operator.inc9
-rw-r--r--modules/taxonomy/views_handler_filter_term_node_tid.inc5
2 files changed, 9 insertions, 5 deletions
diff --git a/handlers/views_handler_filter_in_operator.inc b/handlers/views_handler_filter_in_operator.inc
index 244b53e..fb3c0d5 100644
--- a/handlers/views_handler_filter_in_operator.inc
+++ b/handlers/views_handler_filter_in_operator.inc
@@ -376,6 +376,15 @@ class views_handler_filter_in_operator extends views_handler_filter {
$errors[] = t('The operator is invalud');
}
if (is_array($this->value)) {
+ if (!isset($this->value_options)) {
+ // Don't validate if there are none value options provided, for example for special handlers.
+ return $errors;
+ }
+ if ($this->options['exposed'] && !$this->options['expose']['required'] && empty($this->value)) {
+ // Don't validate if the field is exposed and no default value is provided.
+ return $errors;
+ }
+
// Remove every element which is not known.
foreach ($this->value as $value) {
if (!isset($this->value_options[$value])) {
diff --git a/modules/taxonomy/views_handler_filter_term_node_tid.inc b/modules/taxonomy/views_handler_filter_term_node_tid.inc
index e0d3ec2..5c440c3 100644
--- a/modules/taxonomy/views_handler_filter_term_node_tid.inc
+++ b/modules/taxonomy/views_handler_filter_term_node_tid.inc
@@ -177,11 +177,6 @@ class views_handler_filter_term_node_tid extends views_handler_filter_many_to_on
}
}
- function validate() {
- // Override the validation handler defined by filter_in_operator and do nothing.
- // @todo: Someone could refactor this handler to support get_value_options and do some custom validation for the autocompletion here.
- }
-
function value_validate($form, &$form_state) {
// We only validate if they've chosen the text field style.
if ($this->options['type'] != 'textfield') {