diff --git a/core/includes/update.inc b/core/includes/update.inc index 8a18ebb..9dd8456 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -578,11 +578,6 @@ function update_batch($start, $redirect = NULL, $url = NULL, $batch = array(), $ * @see update_batch() */ function update_finished($success, $results, $operations) { - // Unlock the module system to flush all caches. - module_list_reset(); - // Load all modules, so data structures can be properly rebuilt. - module_load_all(FALSE, TRUE); - // Clear the caches in case the data has been updated. drupal_flush_all_caches(); diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.install b/core/modules/field/modules/field_sql_storage/field_sql_storage.install index 0bbdc5a..2229ef4 100644 --- a/core/modules/field/modules/field_sql_storage/field_sql_storage.install +++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.install @@ -111,9 +111,6 @@ function field_sql_storage_update_8000(&$sandbox) { // Retrieve field data. $fields = _update_7000_field_read_fields(array('storage_type' => 'field_sql_storage')); - // Load private table name helper functions in field_sql_storage.module. - drupal_load('module', 'field_sql_storage'); - // Update schema. foreach ($fields as $field) { $data_table = _field_sql_storage_tablename($field); diff --git a/core/modules/user/user.install b/core/modules/user/user.install index a22b2d8..67957da 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -351,11 +351,11 @@ function user_install() { * The 'Member for' extra field has moved one level up in the array. */ function user_update_8000() { - $settings = update_variable_get('field_bundle_settings_user__user', array()); + $settings = field_bundle_settings('user', 'user'); if (isset($settings['extra_fields']['display']['summary'])) { $settings['extra_fields']['display']['member_for'] = $settings['extra_fields']['display']['summary']; unset($settings['extra_fields']['display']['summary']); - update_variable_set('field_bundle_settings_user__user', $settings); + field_bundle_settings('user', 'user', $settings); } } diff --git a/core/update.php b/core/update.php index 35b42b4..b8a726d 100644 --- a/core/update.php +++ b/core/update.php @@ -129,11 +129,6 @@ function update_script_selection_form($form, &$form_state) { '#links' => update_helpful_links(), ); - // Unlock the module system to flush all caches. - module_list_reset(); - // Load all modules, so data structures can be properly rebuilt. - module_load_all(FALSE, TRUE); - // No updates to run, so caches won't get flushed later. Clear them now. drupal_flush_all_caches(); } @@ -371,6 +366,10 @@ function update_check_requirements($skip_warnings = FALSE) { } } +// Some unavoidable errors happen because the database is not yet up-to-date. +// Our custom error handler is not yet installed, so we just suppress them. +ini_set('display_errors', FALSE); + // We prepare a minimal bootstrap for the update requirements check to avoid // reaching the PHP memory limit. require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc'; @@ -379,23 +378,6 @@ function update_check_requirements($skip_warnings = FALSE) { require_once DRUPAL_ROOT . '/core/includes/file.inc'; require_once DRUPAL_ROOT . '/core/includes/unicode.inc'; require_once DRUPAL_ROOT . '/core/includes/schema.inc'; - -// The module list must be limited to System module for almost all parts of the -// update process to prevent module APIs and hooks from being invoked too early -// (trying to act on data structures that are not updated yet). -// This especially applies to early bootstrap preparations when upgrading to a -// new major version of Drupal core. Unfortunately, however, the initial -// information and update selection pages (and forms) need to be able to invoke -// hook_requirements() in all modules and also access other APIs. Therefore, the -// effective module list has to be switched back and forth multiple times during -// the update.php process. -include_once DRUPAL_ROOT . '/core/includes/module.inc'; -$module_list['system']['filename'] = 'core/modules/system/system.module'; - -// Lock the module list for the update bootstrap and performing initial system -// changes. -module_list(NULL, $module_list); - update_prepare_d8_bootstrap(); // Determine if the current user has access to run update.php. @@ -422,6 +404,9 @@ function update_check_requirements($skip_warnings = FALSE) { require_once DRUPAL_ROOT . '/core/modules/system/system.install'; // Load module basics. + include_once DRUPAL_ROOT . '/core/includes/module.inc'; + $module_list['system']['filename'] = 'core/modules/system/system.module'; + module_list(NULL, $module_list); drupal_load('module', 'system'); // Reset the module_implements() cache so that any new hook implementations @@ -434,9 +419,6 @@ function update_check_requirements($skip_warnings = FALSE) { // Set up theme system for the maintenance page. drupal_maintenance_theme(); - // Unlock the module system to perform update requirements checks. - module_list_reset(); - // 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); @@ -466,9 +448,6 @@ function update_check_requirements($skip_warnings = FALSE) { update_fix_compatibility(); - // Unlock the module system to perform update requirements checks. - module_list_reset(); - // 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 @@ -477,9 +456,6 @@ function update_check_requirements($skip_warnings = FALSE) { $skip_warnings = !empty($continue); update_check_requirements($skip_warnings); - // Re-lock the module system. - module_list(NULL, $module_list); - switch ($op) { // update.php ops. @@ -507,11 +483,6 @@ function update_check_requirements($skip_warnings = FALSE) { break; case 'results': - // Unlock the module system after performing updates. - module_list_reset(); - // Load all modules to flush all caches and rebuild data structures. - module_load_all(FALSE, TRUE); - $output = update_results_page(); break;