diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php index 4c0e931..e648cb6 100644 --- a/core/modules/views/src/Plugin/views/PluginBase.php +++ b/core/modules/views/src/Plugin/views/PluginBase.php @@ -538,15 +538,18 @@ protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $c // Add in negotiated languages, if requested. if ($flags & PluginBase::INCLUDE_NEGOTIATED) { + $types_info = $manager->getDefinedLanguageTypesInfo(); $types = $manager->getLanguageTypes(); - foreach ($types as $id => $type) { - // Surround IDs by '***LANGUAGE_...***', to avoid query collisions. - $id = '***LANGUAGE_' . $id . '***'; - $list[$id] = $this->t('!type language selected for page', array('!type' => $type['name'])); + foreach ($types as $id) { + if (isset($types_info[$id]['name'])) { + $name = $types_info[$id]['name']; + // Surround IDs by '***LANGUAGE_...***', to avoid query collisions. + $id = '***LANGUAGE_' . $id . '***'; + $list[$id] = $this->t('!type language selected for page', array('!type' => $name)); + } } if (!empty($current_values)) { - $types = $manager->getDefinedLanguageTypesInfo(); - foreach ($types as $id => $type) { + foreach ($types_info as $id => $type) { $id = '***LANGUAGE_' . $id . '***'; // If this (non-configurable) type is among the current values, // add that option too, so it is not lost. If not among the current