diff --git a/core/includes/schema.inc b/core/includes/schema.inc index 59c79c0..40ca702 100644 --- a/core/includes/schema.inc +++ b/core/includes/schema.inc @@ -139,13 +139,13 @@ function drupal_get_schema_versions($module) { } } // Ensure that updates are applied in numerical order. - foreach ($updates as $module => &$module_updates) { + foreach ($updates as $module_name => &$module_updates) { // No module is allowed to define a schema update of exactly // \Drupal::CORE_MINIMUM_SCHEMA_VERSION because this is reserved for the // minimum installed version. if (in_array(\Drupal::CORE_MINIMUM_SCHEMA_VERSION, $module_updates)) { - throw new ExtensionSchemaVersionException(format_string("%module's hook_update_N() implementations must use N greater than @version.", array( - '%module' => $module, + throw new ExtensionSchemaVersionException(format_string("%module_name's hook_update_N() implementations must use N greater than @version.", array( + '%module_name' => $module_name, '@version' => \Drupal::CORE_MINIMUM_SCHEMA_VERSION, ))); } diff --git a/core/includes/update.inc b/core/includes/update.inc index 0649254..ba5242b 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -147,7 +147,7 @@ function update_prepare_d8_bootstrap() { catch (\Exception $e) { $system_schema = db_query('SELECT schema_version FROM {system} WHERE name = :system', array(':system' => 'system'))->fetchField(); } - if ($system_schema < \Drupal::MINIMUM_CORE_SCHEMA_VERSION) { + if ($system_schema < \Drupal::CORE_MINIMUM_SCHEMA_VERSION) { $requirements = array( 'drupal 7 version' => array( 'title' => 'Drupal 7 version', diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php index b09b30b..65d9224 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php @@ -165,7 +165,10 @@ function testNoUpdateFunctionality() { * Tests update.php after performing a successful update. */ function testSuccessfulUpdateFunctionality() { - drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test') - 1); + // Set the installed schema version to one less than the current update. + // Reset the static cache to ensure we have the most current setting. + drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test', TRUE) - 1); + // Click through update.php with 'administer software updates' permission. $this->drupalLogin($this->update_user); $this->drupalPostForm($this->update_url, array(), t('Continue'), array('external' => TRUE)); @@ -178,7 +181,10 @@ function testSuccessfulUpdateFunctionality() { $this->clickLink('Front page'); $this->assertResponse(200); - drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test') - 1); + // Set the installed schema version to one less than the current update. + // Reset the static cache to ensure we have the most current setting. + drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test', TRUE) - 1); + // Click through update.php with 'access administration pages' and // 'access site reports' permissions. $admin_user = $this->drupalCreateUser(array('administer software updates', 'access administration pages', 'access site reports')); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index d99b6a0..c6ad793 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1161,3 +1161,18 @@ function system_schema() { function system_update_last_removed() { return 7069; } + +/** + * @todo Remove. + */ +function system_update_8001() {} + +/** + * @todo Remove. + */ +function system_update_8002() {} + +/** + * @todo Remove. + */ +function system_update_8003() {}