diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-16 08:28:08 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-16 08:28:08 +0000 |
commit | 30d7bd56f7b9d22bbbcdfc31bb128c460a986822 (patch) | |
tree | a5026b387c6455c0125005aa9d9a7d306e2624d9 /modules/system/system.module | |
parent | 968a51a442059feb4faabbec018970c7cc29a391 (diff) | |
download | brdo-30d7bd56f7b9d22bbbcdfc31bb128c460a986822.tar.gz brdo-30d7bd56f7b9d22bbbcdfc31bb128c460a986822.tar.bz2 |
#93212 by Jaza. Refactor module enabling for greater API avialiablity during hook_enable().
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 1e2d9e938..9bc448f1e 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1442,13 +1442,14 @@ function system_modules_submit($form_id, $form_values) { } } + $enable_modules = array(); foreach ($form_values['status'] as $key => $choice) { if ($choice) { if (drupal_get_installed_schema_version($key) == SCHEMA_UNINSTALLED) { $new_modules[] = $key; } else { - module_enable($key); + $enable_modules[] = $key; } } else { @@ -1456,14 +1457,19 @@ function system_modules_submit($form_id, $form_values) { } } + if (!empty($enable_modules)) { + module_enable($enable_modules); + } + $old_module_list = module_list(); // Install new modules. - foreach ($new_modules as $module) { - if (drupal_check_module($module)) { - drupal_install_module($module); + foreach ($new_modules as $key => $module) { + if (!drupal_check_module($module)) { + unset($new_modules[$key]); } } + drupal_install_modules($new_modules); $current_module_list = module_list(TRUE, FALSE); |