diff -u b/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php --- b/core/lib/Drupal/Core/Config/ConfigFactory.php +++ b/core/lib/Drupal/Core/Config/ConfigFactory.php @@ -125,30 +125,37 @@ return $config[$name]; } else { - // If the configuration object does not exist in the configuration storage - // create a new object and add it to the static cache. $cache_key = $this->getCacheKey($name); - $this->cache[$cache_key] = new Config($name, $this->storage, $this->eventDispatcher, $this->typedConfigManager, $this->language); + // If the config object has been deleted it will already exist in the + // cache but self::loadMultiple does not return such objects. + // @todo Explore making ConfigFactory a listener to the config.delete + // event to reset the static cache when this occurs. + if (!isset($this->cache[$cache_key])) { + // If the configuration object does not exist in the configuration + // storage or static cache create a new object and add it to the static + // cache. + $this->cache[$cache_key] = new Config($name, $this->storage, $this->eventDispatcher, $this->typedConfigManager, $this->language); - if ($this->canOverride($name)) { - // Get and apply any language overrides. - if ($this->language) { - $language_overrides = $this->storage->read($this->getLanguageConfigName($this->language->id, $name)); - } - else { - $language_overrides = FALSE; - } - if (is_array($language_overrides)) { - $this->cache[$cache_key]->setLanguageOverride($language_overrides); - } - // Get and apply any module overrides. - $module_overrides = $this->loadModuleOverrides(array($name)); - if (isset($module_overrides[$name])) { - $this->cache[$cache_key]->setModuleOverride($module_overrides[$name]); - } - // Apply any settigns.php overrides. - if (isset($conf[$name])) { - $this->cache[$cache_key]->setSettingsOverride($conf[$name]); + if ($this->canOverride($name)) { + // Get and apply any language overrides. + if ($this->language) { + $language_overrides = $this->storage->read($this->getLanguageConfigName($this->language->id, $name)); + } + else { + $language_overrides = FALSE; + } + if (is_array($language_overrides)) { + $this->cache[$cache_key]->setLanguageOverride($language_overrides); + } + // Get and apply any module overrides. + $module_overrides = $this->loadModuleOverrides(array($name)); + if (isset($module_overrides[$name])) { + $this->cache[$cache_key]->setModuleOverride($module_overrides[$name]); + } + // Apply any settigns.php overrides. + if (isset($conf[$name])) { + $this->cache[$cache_key]->setSettingsOverride($conf[$name]); + } } } return $this->cache[$cache_key];