You are here

function update_update_page in Drupal 4

Same name and namespace in other branches
  1. 5 update.php \update_update_page()
1 call to update_update_page()
update.php in ./update.php
Administrative page for handling updates from one Drupal version to another.

File

./update.php, line 361
Administrative page for handling updates from one Drupal version to another.

Code

function update_update_page() {

  // Set the installed version so updates start at the correct place.
  $_SESSION['update_remaining'] = array();
  foreach ($_POST['edit']['start'] as $module => $version) {
    drupal_set_installed_schema_version($module, $version - 1);
    $max_version = max(drupal_get_schema_versions($module));
    if ($version <= $max_version) {
      foreach (range($version, $max_version) as $update) {
        $_SESSION['update_remaining'][] = array(
          'module' => $module,
          'version' => $update,
        );
      }
    }
  }

  // Keep track of total number of updates
  $_SESSION['update_total'] = count($_SESSION['update_remaining']);
  if ($_POST['edit']['has_js']) {
    return update_progress_page();
  }
  else {
    return update_progress_page_nojs();
  }
}