summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 2f3a41385..bf2250d79 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -472,6 +472,10 @@ function system_view_general() {
$form['cron'] = array('#type' => 'fieldset', '#title' => t('Cron jobs'), '#collapsible' => TRUE, '#collapsed' => TRUE);
$form['cron'] = array_merge($form['cron'], system_cron_settings());
+ // Check database setup if necessary
+ if (function_exists('db_check_setup') && empty($_POST)) {
+ db_check_setup();
+ }
return $form;
}
@@ -1010,8 +1014,8 @@ function system_modules_submit($form_id, $edit) {
foreach ($new_modules as $module) {
// Set the installed schema version for newly-enabled modules
$versions = drupal_get_schema_versions($module);
- if ($versions !== FALSE && drupal_get_installed_schema_version($module) == 0) {
- drupal_set_installed_schema_version($module, max($versions));
+ if (drupal_get_installed_schema_version($module) == SCHEMA_UNINSTALLED) {
+ drupal_set_installed_schema_version($module, $versions ? max($versions) : SCHEMA_INSTALLED);
}
}