Created
July 7, 2021 12:35
-
-
Save podarok/5effdad62fef588dab044f45c402d474 to your computer and use it in GitHub Desktop.
core_check_service_language.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/modules/language/language.module b/core/modules/language/language.module | |
index 91641dec..cac5f59a 100644 | |
--- a/core/modules/language/language.module | |
+++ b/core/modules/language/language.module | |
@@ -294,11 +294,13 @@ function language_modules_installed($modules) { | |
// Since newly (un)installed modules may change the default settings for | |
// non-locked language types (e.g. content language), we need to resave the | |
// language type configuration. | |
- /** @var \Drupal\language\LanguageNegotiatorInterface $negotiator */ | |
- $negotiator = \Drupal::service('language_negotiator'); | |
- $configurable = \Drupal::config('language.types')->get('configurable'); | |
- $negotiator->updateConfiguration($configurable); | |
- $negotiator->purgeConfiguration(); | |
+ if (!empty(\Drupal::hasService('language_negotiator'))) { | |
+ /** @var \Drupal\language\LanguageNegotiatorInterface $negotiator */ | |
+ $negotiator = \Drupal::service('language_negotiator'); | |
+ $configurable = \Drupal::config('language.types')->get('configurable'); | |
+ $negotiator->updateConfiguration($configurable); | |
+ $negotiator->purgeConfiguration(); | |
+ } | |
} | |
else { | |
// In language_entity_base_field_info_alter() we are altering view/form |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment