diff -u b/core/includes/config.inc b/core/includes/config.inc --- b/core/includes/config.inc +++ b/core/includes/config.inc @@ -18,16 +18,30 @@ /** * Installs the default configuration of a given extension. * + * When an extension is installed, it searches all the default configuration + * directories for all other extensions to locate any configuration with its + * name prefix. For example, the Node module provides the frontpage view as a + * default configuration file: + * core/modules/node/config/views.view.frontpage.yml + * When the Views module is installed after the Node module is already enabled, + * the frontpage view will be installed. + * + * Additionally, the default configuration directory for the extension being + * installed is searched to discover if it contains default configuration + * that is owned by other enabled extensions. So, the frontpage view will also + * be installed when the Node module is installed after Views. + * * @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. + * + * @see \Drupal\Core\Config\ExtensionInstallStorage + * @see \Drupal\Core\Config\ExtensionInstallStorageComparer + * @see \Drupal\Core\Config\ConfigInstaller */ function config_install_default_config($type, $name) { - // Get all default configuration owned by this extension. This will return any - // configuration that starts with the extension name that exists in any - // enabled extension's config directory. This includes the extension that is - // being installed. + // Get all default configuration owned by this extension. $source_storage = new ExtensionInstallStorage(); $config_to_install = $source_storage->listAll($name . '.'); only in patch2: unchanged: --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1476,15 +1476,16 @@ function theme_enable($theme_list) { } // The value is not used; the weight is ignored for themes currently. - $theme_config->set("enabled.$key", 0); - $disabled_themes->clear($key); + $theme_config->set("enabled.$key", 0)->save();; + $disabled_themes->clear($key)->save(); + + // Refresh the theme list as config_install_default_config() needs an + // updated list to work. + list_themes(TRUE); // Install default configuration of the theme. config_install_default_config('theme', $key); } - $theme_config->save(); - $disabled_themes->save(); - list_themes(TRUE); Drupal::service('router.builder')->rebuild(); menu_router_rebuild(); drupal_theme_rebuild();