diff options
Diffstat (limited to 'modules/system/system.admin.inc')
-rw-r--r-- | modules/system/system.admin.inc | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index cafe079bd..868bd4315 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1168,6 +1168,7 @@ function system_modules_submit($form, &$form_state) { if ($module['enabled']) { if (drupal_get_installed_schema_version($name) == SCHEMA_UNINSTALLED) { $actions['install'][] = $name; + $actions['enable'][] = $name; } elseif (!module_exists($name)) { $actions['enable'][] = $name; @@ -1183,37 +1184,27 @@ function system_modules_submit($form, &$form_state) { $pre_install_list = module_list(); unset($form_state['storage']); + // Reverse the 'enable' list, to order dependencies before dependents. + rsort($actions['enable']); + // Installs, enables, and disables modules. - module_enable($actions['enable']); - module_disable($actions['disable']); - module_enable($actions['install']); + module_enable($actions['enable'], FALSE); + module_disable($actions['disable'], FALSE); - // Gets module list after install process, displays message if there are changes. + // Gets module list after install process, flushes caches and displays a + // message if there are changes. $post_install_list = module_list(TRUE); if ($pre_install_list != $post_install_list) { + drupal_flush_all_caches(); drupal_set_message(t('The configuration options have been saved.')); } - // Clear all caches. - registry_rebuild(); - system_rebuild_theme_data(); - drupal_theme_rebuild(); - node_types_rebuild(); - menu_rebuild(); - cache_clear_all('schema', 'cache'); - entity_info_cache_clear(); - drupal_clear_css_cache(); - drupal_clear_js_cache(); - $form_state['redirect'] = 'admin/modules'; // Notify locale module about module changes, so translations can be // imported. This might start a batch, and only return to the redirect // path after that. module_invoke('locale', 'system_update', $actions['install']); - - // Synchronize to catch any actions that were added or removed. - actions_synchronize(); } /** |