diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-14 05:47:36 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-08-14 05:47:36 +0000 |
commit | d9d43eea27156f12e6a0b6fdbe9a5db774622574 (patch) | |
tree | 8606d2a89a8246f5ae287ea35299af3a5b701200 /update.php | |
parent | 457f5847cb979dd5b7461caef2fe4eb09ef5a9fc (diff) | |
download | brdo-d9d43eea27156f12e6a0b6fdbe9a5db774622574.tar.gz brdo-d9d43eea27156f12e6a0b6fdbe9a5db774622574.tar.bz2 |
#64212 by chx, dww, and Eaton, allow for branched updates.
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 18 |
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); + } } } } |