diff --git a/core/modules/language/lib/Drupal/language/LanguageServiceProvider.php b/core/modules/language/lib/Drupal/language/LanguageServiceProvider.php index 95eb700..3334389 100644 --- a/core/modules/language/lib/Drupal/language/LanguageServiceProvider.php +++ b/core/modules/language/lib/Drupal/language/LanguageServiceProvider.php @@ -7,7 +7,7 @@ namespace Drupal\language; -use Drupal\Core\Config\BootstrapConfigStorageFactory; +use Drupal\Component\Utility\Settings; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderBase; use Drupal\Core\Language\Language; @@ -79,11 +79,15 @@ protected function isMultilingual() { // @todo Try to swap out for config.storage to take advantage of database // and caching. This might prove difficult as this is called before the // container has finished building. - $config_storage = BootstrapConfigStorageFactory::get(); - $config_ids = array_filter($config_storage->listAll($prefix), function($config_id) use ($prefix) { - return $config_id != $prefix . Language::LANGCODE_NOT_SPECIFIED && $config_id != $prefix . Language::LANGCODE_NOT_APPLICABLE; - }); - return count($config_ids) > 1; + $bootstrap_config_storage = Settings::get('bootstrap_config_storage'); + if (is_callable($bootstrap_config_storage)) { + $config_storage = call_user_func($bootstrap_config_storage); + $config_ids = array_filter($config_storage->listAll($prefix), function($config_id) use ($prefix) { + return $config_id != $prefix . Language::LANGCODE_NOT_SPECIFIED && $config_id != $prefix . Language::LANGCODE_NOT_APPLICABLE; + }); + return count($config_ids) > 1; + } + return FALSE; } /** @@ -95,11 +99,14 @@ protected function isMultilingual() { * otherwise FALSE. */ protected function getDefaultLanguageValues() { - $config_storage = BootstrapConfigStorageFactory::get(); - $system = $config_storage->read('system.site'); - $default_language = $config_storage->read(static::CONFIG_PREFIX . $system['langcode']); - if (is_array($default_language)) { - return $default_language + array('default' => TRUE); + $bootstrap_config_storage = Settings::get('bootstrap_config_storage'); + if (is_callable($bootstrap_config_storage)) { + $config_storage = call_user_func($bootstrap_config_storage); + $system = $config_storage->read('system.site'); + $default_language = $config_storage->read(static::CONFIG_PREFIX . $system['langcode']); + if (is_array($default_language)) { + return $default_language + array('default' => TRUE); + } } return FALSE; }