Skip to content
Snippets Groups Projects
Commit c7dc1e85 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #1712352 by sun: configuration system does not support themes.

parent d1ea099f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -12,22 +12,24 @@ ...@@ -12,22 +12,24 @@
*/ */
/** /**
* Installs the default configuration of a given module. * Installs the default configuration of a given extension.
* *
* @param * @param string $type
* The name of the module we are installing. * The extension type; e.g., 'module' or 'theme'.
* @param string $name
* The name of the module or theme to install default configuration for.
* *
* @todo Make this acknowledge other storage engines rather than having * @todo Make this acknowledge other storage engines rather than having
* SQL be hardcoded. * SQL be hardcoded.
*/ */
function config_install_default_config($module) { function config_install_default_config($type, $name) {
$module_config_dir = drupal_get_path('module', $module) . '/config'; $config_dir = drupal_get_path($type, $name) . '/config';
if (is_dir($module_config_dir)) { if (is_dir($config_dir)) {
$source_storage = new FileStorage(array('directory' => $module_config_dir)); $source_storage = new FileStorage(array('directory' => $config_dir));
$target_storage = new DatabaseStorage(); $target_storage = new DatabaseStorage();
$null_storage = new NullStorage(); $null_storage = new NullStorage();
// Upon module installation, only new config objects need to be created. // Upon installation, only new config objects need to be created.
// config_sync_get_changes() would potentially perform a diff of hundreds or // config_sync_get_changes() would potentially perform a diff of hundreds or
// even thousands of config objects that happen to be contained in the // even thousands of config objects that happen to be contained in the
// active store. We leverage the NullStorage to avoid that needless // active store. We leverage the NullStorage to avoid that needless
......
...@@ -387,7 +387,7 @@ function drupal_install_system() { ...@@ -387,7 +387,7 @@ function drupal_install_system() {
system_rebuild_module_data(); system_rebuild_module_data();
system_rebuild_theme_data(); system_rebuild_theme_data();
config_install_default_config('system'); config_install_default_config('module', 'system');
module_invoke('system', 'install'); module_invoke('system', 'install');
} }
......
...@@ -462,7 +462,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) { ...@@ -462,7 +462,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
$version = $versions ? max($versions) : SCHEMA_INSTALLED; $version = $versions ? max($versions) : SCHEMA_INSTALLED;
// Install default configuration of the module. // Install default configuration of the module.
config_install_default_config($module); config_install_default_config('module', $module);
// If the module has no current updates, but has some that were // If the module has no current updates, but has some that were
// previously removed, set the version to the value of // previously removed, set the version to the value of
......
...@@ -1417,6 +1417,9 @@ function theme_enable($theme_list) { ...@@ -1417,6 +1417,9 @@ function theme_enable($theme_list) {
->condition('type', 'theme') ->condition('type', 'theme')
->condition('name', $key) ->condition('name', $key)
->execute(); ->execute();
// Install default configuration of the theme.
config_install_default_config('theme', $key);
} }
list_themes(TRUE); list_themes(TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment