Commit f1132890 authored by catch's avatar catch
Browse files

Issue #3177546 by alexpott:...

Issue #3177546 by alexpott: \Drupal\views\Plugin\views\PluginBase::listLanguages() incorrectly uses in_array() resulting in listing additional languages
parent a33344f9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ public function testFilter() {
          'id' => 'langcode',
          'table' => 'views_test_data',
          'field' => 'langcode',
          'value' => [$langcode],
          'value' => [$langcode => $langcode],
        ],
      ]);
      $this->executeView($view);
@@ -44,7 +44,6 @@ public function testFilter() {
      $expected = [
        '***LANGUAGE_site_default***',
        '***LANGUAGE_language_interface***',
        '***LANGUAGE_language_content***',
        'en',
        'xx-lolspeak',
        'und',
+1 −1
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $c
          // If this (non-configurable) type is among the current values,
          // add that option too, so it is not lost. If not among the current
          // values, skip displaying it to avoid user confusion.
          if (isset($type['name']) && !isset($list[$id]) && in_array($id, $current_values)) {
          if (isset($type['name']) && !isset($list[$id]) && in_array($id, $current_values, TRUE)) {
            $list[$id] = $this->t('@type language selected for page', ['@type' => $type['name']]);
          }
        }