summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'update.php')
-rw-r--r--update.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/update.php b/update.php
index 3713d2178..039e882ac 100644
--- a/update.php
+++ b/update.php
@@ -337,11 +337,18 @@ function update_selection_page() {
if ($updates !== FALSE) {
$updates = drupal_map_assoc($updates);
$updates[] = 'No updates available';
+ $default = drupal_get_installed_schema_version($module);
+ foreach (array_keys($updates) as $update) {
+ if ($update > $default) {
+ $default = $update;
+ break;
+ }
+ }
$form['start'][$module] = array(
'#type' => 'select',
'#title' => $module . ' module',
- '#default_value' => array_search(drupal_get_installed_schema_version($module), $updates) + 1,
+ '#default_value' => $default,
'#options' => $updates,
);
}
@@ -369,10 +376,13 @@ function update_update_page() {
// Set the installed version so updates start at the correct place.
foreach ($_POST['edit']['start'] as $module => $version) {
drupal_set_installed_schema_version($module, $version - 1);
- $max_version = max(drupal_get_schema_versions($module));
+ $updates = drupal_get_schema_versions($module);
+ $max_version = max($updates);
if ($version <= $max_version) {
- foreach (range($version, $max_version) as $update) {
- $_SESSION['update_remaining'][] = array('module' => $module, 'version' => $update);
+ foreach ($updates as $update) {
+ if ($update >= $version) {
+ $_SESSION['update_remaining'][] = array('module' => $module, 'version' => $update);
+ }
}
}
}