summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-16 08:28:08 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-16 08:28:08 +0000
commit30d7bd56f7b9d22bbbcdfc31bb128c460a986822 (patch)
treea5026b387c6455c0125005aa9d9a7d306e2624d9 /modules/system/system.module
parent968a51a442059feb4faabbec018970c7cc29a391 (diff)
downloadbrdo-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.module14
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);