diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-09-30 15:08:10 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-09-30 15:08:10 -0700 |
commit | 25a927031c218d7bd49da1bad5f97bef690a7518 (patch) | |
tree | f60cbcc9d9aabc492193442ab555dce753bd1fc6 /update.php | |
parent | e120a6e886a40eaf135f6032aa47e3eeeb58b3af (diff) | |
download | brdo-25a927031c218d7bd49da1bad5f97bef690a7518.tar.gz brdo-25a927031c218d7bd49da1bad5f97bef690a7518.tar.bz2 |
Issue #1289364 by swentel: Fixed SchemaCache generates empty cid.
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/update.php b/update.php index ac594ff85..865072031 100644 --- a/update.php +++ b/update.php @@ -245,7 +245,8 @@ function update_info_page() { $output .= "<li>Install your new files in the appropriate location, as described in the handbook.</li>\n"; $output .= "</ol>\n"; $output .= "<p>When you have performed the steps above, you may proceed.</p>\n"; - $output .= '<form method="post" action="update.php?op=selection&token=' . $token . '"><p><input type="submit" value="Continue" class="form-submit" /></p></form>'; + $form_action = check_url(drupal_current_script_url(array('op' => 'selection', 'token' => $token))); + $output .= '<form method="post" action="' . $form_action . '"><p><input type="submit" value="Continue" class="form-submit" /></p></form>'; $output .= "\n"; return $output; } @@ -316,20 +317,26 @@ function update_extra_requirements($requirements = NULL) { } /** - * Check update requirements and report any errors. + * Check update requirements and report any errors or (optionally) warnings. + * + * @param $skip_warnings + * (optional) If set to TRUE, requirement warnings will be ignored, and a + * report will only be issued if there are requirement errors. Defaults to + * FALSE. */ -function update_check_requirements() { +function update_check_requirements($skip_warnings = FALSE) { // Check requirements of all loaded modules. $requirements = module_invoke_all('requirements', 'update'); $requirements += update_extra_requirements(); $severity = drupal_requirements_severity($requirements); - // If there are issues, report them. - if ($severity == REQUIREMENT_ERROR) { + // If there are errors, always display them. If there are only warnings, skip + // them if the caller has indicated they should be skipped. + if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && !$skip_warnings)) { update_task_list('requirements'); drupal_set_title('Requirements problem'); $status_report = theme('status_report', array('requirements' => $requirements)); - $status_report .= 'Check the error messages and <a href="' . check_url(request_uri()) . '">try again</a>.'; + $status_report .= 'Check the error messages and <a href="' . check_url(drupal_requirements_url($severity)) . '">try again</a>.'; print theme('update_page', array('content' => $status_report)); exit(); } @@ -385,8 +392,9 @@ if (empty($op) && update_access_allowed()) { // Set up theme system for the maintenance page. drupal_maintenance_theme(); - // Check the update requirements for Drupal. - update_check_requirements(); + // Check the update requirements for Drupal. Only report on errors at this + // stage, since the real requirements check happens further down. + update_check_requirements(TRUE); // Redirect to the update information page if all requirements were met. install_goto('update.php?op=info'); @@ -418,8 +426,12 @@ if (update_access_allowed()) { update_fix_compatibility(); - // Check the update requirements for all modules. - update_check_requirements(); + // Check the update requirements for all modules. If there are warnings, but + // no errors, skip reporting them if the user has provided a URL parameter + // acknowledging the warnings and indicating a desire to continue anyway. See + // drupal_requirements_url(). + $skip_warnings = !empty($_GET['continue']); + update_check_requirements($skip_warnings); $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; switch ($op) { @@ -433,7 +445,12 @@ if (update_access_allowed()) { case 'Apply pending updates': if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) { - update_batch($_POST['start'], $base_url . '/update.php?op=results', $base_url . '/update.php'); + // Generate absolute URLs for the batch processing (using $base_root), + // since the batch API will pass them to url() which does not handle + // update.php correctly by default. + $batch_url = $base_root . drupal_current_script_url(); + $redirect_url = $base_root . drupal_current_script_url(array('op' => 'results')); + update_batch($_POST['start'], $redirect_url, $batch_url); break; } |