From d2c9b80d83b121c306b8c183be5c7af880f684fa Mon Sep 17 00:00:00 2001 From: dereine <dereine@99340.no-reply.drupal.org> Date: Mon, 20 Aug 2012 13:47:30 +0200 Subject: [PATCH] Issue #1720734 by dawehner, damiankloip: Allow many to one handler to work with strings. --- .../views/Plugin/views/argument/ManyToOne.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/Drupal/views/Plugin/views/argument/ManyToOne.php b/lib/Drupal/views/Plugin/views/argument/ManyToOne.php index a5f68d5631e1..b06f3ee708dd 100644 --- a/lib/Drupal/views/Plugin/views/argument/ManyToOne.php +++ b/lib/Drupal/views/Plugin/views/argument/ManyToOne.php @@ -63,15 +63,13 @@ function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); // allow + for or, , for and - if (!empty($this->definition['numeric'])) { - $form['break_phrase'] = array( - '#type' => 'checkbox', - '#title' => t('Allow multiple values'), - '#description' => t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), - '#default_value' => !empty($this->options['break_phrase']), - '#fieldset' => 'more', - ); - } + $form['break_phrase'] = array( + '#type' => 'checkbox', + '#title' => t('Allow multiple values'), + '#description' => t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), + '#default_value' => !empty($this->options['break_phrase']), + '#fieldset' => 'more', + ); $form['add_table'] = array( '#type' => 'checkbox', @@ -118,7 +116,12 @@ function query($group_by = FALSE) { } if (!empty($this->options['break_phrase'])) { - views_break_phrase($this->argument, $this); + if (!empty($this->definition['nummeric'])) { + views_break_phrase($this->argument, $this); + } + else { + views_break_phrase_string($this->argument, $this); + } } else { $this->value = array($this->argument); -- GitLab