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 @@ -226,15 +226,7 @@ } /** - * Installs all default configuration in a particular collection. - * - * The function is useful if the site needs to respond to an event that has - * just created another collection and we need to check all the installed - * extensions for any matching configuration. For example, if a language has - * just been created. - * - * @param string $collection - * The configuration collection. + * {@inheritdoc} */ public function installCollectionDefaultConfig($collection) { $config_to_install = $this->getSourceStorage($collection)->listAll(); diff -u b/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php --- b/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -173,6 +173,13 @@ foreach ($config_names as $config_name) { $this->configFactory->get($config_name)->delete(); } + + // Remove any matching configuration from collections. + foreach ($this->activeStorage->getAllCollectionNames() as $collection) { + $collection_storage = $this->activeStorage->createCollection($collection); + $collection_storage->deleteAll($name . '.'); + } + $schema_dir = drupal_get_path($type, $name) . '/' . InstallStorage::CONFIG_SCHEMA_DIRECTORY; if (is_dir($schema_dir)) { // Refresh the schema cache if uninstalling an extension that provides diff -u b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php --- b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php @@ -133,6 +133,13 @@ $collection_storage = $active_storage->createCollection('entity'); $data = $collection_storage->read('config_test.dynamic.dotted.default'); $this->assertIdentical(array('label' => 'entity'), $data); + + // Test that the config manager uninstalls configuration from collections + // as expected. + \Drupal::service('config.manager')->uninstall('module', 'config_collection_install_test'); + $this->assertEqual(array('entity'), $active_storage->getAllCollectionNames()); + \Drupal::service('config.manager')->uninstall('module', 'config_test'); + $this->assertEqual(array(), $active_storage->getAllCollectionNames()); } /** only in patch2: unchanged: --- a/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php +++ b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php @@ -38,6 +38,19 @@ public function installDefaultConfig($type, $name); /** + * Installs all default configuration in the specified collection. + * + * The function is useful if the site needs to respond to an event that has + * just created another collection and we need to check all the installed + * extensions for any matching configuration. For example, if a language has + * just been created. + * + * @param string $collection + * The configuration collection. + */ + public function installCollectionDefaultConfig($collection); + + /** * Sets the configuration storage that provides the default configuration. * * @param \Drupal\Core\Config\StorageInterface $storage