diff -u b/core/includes/config.inc b/core/includes/config.inc --- b/core/includes/config.inc +++ b/core/includes/config.inc @@ -16,6 +16,22 @@ */ /** + * Uninstalls the default configuration of a given extension. + * + * @param string $type + * The extension type; e.g., 'module' or 'theme'. + * @param string $name + * The name of the module or theme to install default configuration for. + */ +function config_uninstall_default_config($type, $name) { + $storage = \Drupal::service('config.storage'); + $config_names = $storage->listAll($name . '.'); + foreach ($config_names as $config_name) { + \Drupal::config($config_name)->delete(); + } +} + +/** * Gets configuration object names starting with a given prefix. * * @see \Drupal\Core\Config\StorageInterface::listAll() diff -u b/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php --- b/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -145,11 +145,2 @@ - /** - * {@inheritdoc} - */ - public function uninstallDefaultConfig($type, $name){ - $config_names = $this->activeStorage->listAll($name . '.'); - foreach ($config_names as $config_name) { - $this->configFactory->get($config_name)->delete(); - } - } } diff -u b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php --- b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php +++ b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php @@ -39,11 +39,2 @@ - /** - * Uninstalls the default configuration of a given extension. - * - * @param string $type - * The extension type; e.g., 'module' or 'theme'. - * @param string $name - * The name of the module or theme to install default configuration for. - */ - public function uninstallDefaultConfig($type, $name); } diff -u b/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php --- b/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -724,7 +724,7 @@ drupal_uninstall_schema($module); // Remove all configuration belonging to the module. - \Drupal::service('config.installer')->uninstallDefaultConfig('module', $module); + config_uninstall_default_config('module', $module); // Remove the module's entry from the config. $module_config->clear("enabled.$module")->save();