Commit 1ada16f8 authored by Stephen Mustgrave's avatar Stephen Mustgrave Committed by Markus Kalkbrenner
Browse files

Issue #3279735 by Jaydev Bhatt, smustgrave, tishmg, mkalkbrenner: Dependent...

Issue #3279735 by Jaydev Bhatt, smustgrave, tishmg, mkalkbrenner: Dependent Facet does not allow multiple values when values have leading spaces
parent 1cb7c7e8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ class DependentFacetProcessor extends ProcessorPluginBase implements BuildProces
        '#title' => $this->t('Values'),
        '#type' => 'textfield',
        '#default_value' => empty($config[$facet->id()]['values']) ? '' : $config[$facet->id()]['values'],
        '#description' => $this->t('Enter a comma-separated list of values. Example: value1, value2, value3'),
        '#states' => [
          'visible' => [
            ':input[name="facet_settings[' . $this->getPluginId() . '][settings][' . $facet->id() . '][enable]"]' => ['checked' => TRUE],
@@ -205,7 +206,7 @@ class DependentFacetProcessor extends ProcessorPluginBase implements BuildProces
    if ($condition_settings['condition'] === 'values') {
      $return = FALSE;

      $values = explode(',', $condition_settings['values']);
      $values = array_map('trim', explode(',', $condition_settings['values']));
      foreach ($facet->getActiveItems() as $value) {
        if (in_array($value, $values)) {
          $return = TRUE;