Skip to content
Snippets Groups Projects
Commit 0506d2cb authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2370733 by chx: Fixed Contrib can not provide config storage.

parent 338c7914
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -18,16 +18,22 @@ class BootstrapConfigStorageFactory {
/**
* Returns a configuration storage implementation.
*
* @param $class_loader
* The class loader. Normally Composer's ClassLoader, as included by the
* front controller, but may also be decorated; e.g.,
* \Symfony\Component\ClassLoader\ApcClassLoader.
*
* @return \Drupal\Core\Config\StorageInterface
* A configuration storage implementation.
*/
public static function get() {
public static function get($class_loader = NULL) {
$bootstrap_config_storage = Settings::get('bootstrap_config_storage');
$storage_backend = FALSE;
if (!empty($bootstrap_config_storage) && is_callable($bootstrap_config_storage)) {
return call_user_func($bootstrap_config_storage);
$storage_backend = call_user_func($bootstrap_config_storage, $class_loader);
}
// Fallback to the DatabaseStorage.
return self::getDatabaseStorage();
return $storage_backend ?: self::getDatabaseStorage();
}
/**
......
......@@ -1171,7 +1171,7 @@ protected function getConfigStorage() {
// The active configuration storage may not exist yet; e.g., in the early
// installer. Catch the exception thrown by config_get_config_directory().
try {
$this->configStorage = BootstrapConfigStorageFactory::get();
$this->configStorage = BootstrapConfigStorageFactory::get($this->classLoader);
}
catch (\Exception $e) {
$this->configStorage = new NullStorage();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment