diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index a77bb1c..163df5c 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -604,7 +604,13 @@ protected function getProfileStorages($installing_name = '') { * The extension's default configuration directory. */ protected function getDefaultConfigDirectory($type, $name) { - return $this->drupalGetPath($type, $name) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; + if ($type === 'module' || $type === 'profile') { + return dirname(\Drupal::service('module_listing')->getFilenames()[$name]) + . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; + } + else { + return $this->drupalGetPath($type, $name) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; + } } /** diff --git a/core/lib/Drupal/Core/Extension/ExtensionList.php b/core/lib/Drupal/Core/Extension/ExtensionList.php index c9a2736..3e98d84 100644 --- a/core/lib/Drupal/Core/Extension/ExtensionList.php +++ b/core/lib/Drupal/Core/Extension/ExtensionList.php @@ -165,9 +165,9 @@ public function listExtensions() { if (isset($this->extensions)) { return $this->extensions; } - if ($extensions = $this->cache->get($this->getCacheId())) { - $this->extensions = $extensions; - return $extensions; + if ($cache = $this->cache->get($this->getCacheId())) { + $this->extensions = $cache->data; + return $this->extensions; } $extensions = $this->doListExtensions(); $this->cache->set($this->getCacheId(), $extensions); @@ -291,7 +291,7 @@ protected function recalculateFilenames() { foreach ($extensions as $name => $extension) { $file_names[$name] = $extension->getPathname(); } - \Drupal::state()->set("system.{$this->type}.files", $file_names); +// \Drupal::state()->set("system.{$this->type}.files", $file_names); return $file_names; } diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index f8300cb..9c652ba 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -171,7 +171,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) { $module_filenames[$name] = $current_module_filenames[$name]; } else { - $module_path = drupal_get_path('module', $name); + $module_path = dirname(\Drupal::service('module_listing')->getFilenames()[$name]); $pathname = "$module_path/$name.info.yml"; $filename = file_exists($module_path . "/$name.module") ? "$name.module" : NULL; $module_filenames[$name] = new Extension($this->root, 'module', $pathname, $filename);