diff --git a/core/modules/language/src/Entity/ConfigurableLanguage.php b/core/modules/language/src/Entity/ConfigurableLanguage.php index 7279a15..ecc1e1b 100644 --- a/core/modules/language/src/Entity/ConfigurableLanguage.php +++ b/core/modules/language/src/Entity/ConfigurableLanguage.php @@ -124,7 +124,9 @@ public function preSave(EntityStorageInterface $storage) { // When adding a new language the weight shouldn't be zero to avoid a // reordering of the languages list when their names change i.e. interface // translation. - $languages = \Drupal::languageManager()->getLanguages(); + // Fetch all configurable languages ordered by weight. + $languages = \Drupal::languageManager()->getLanguages($this::STATE_CONFIGURABLE); + // Retrieve the last. $last_language = end($languages); // When adding the first Configurable language leave the weight by default. // This happens when you are installing language module.