diff --git a/core/includes/update.inc b/core/includes/update.inc index 61de857..d2f2c58 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -229,8 +229,9 @@ function update_do_one($module, $number, $dependency_map, &$context) { function update_invoke_post_update($function, &$context) { $ret = []; - // Do not run any post update hooks if there are failed or pending updates. - if (!empty(update_get_update_list(TRUE))) { + // If this update was aborted in a previous step, or has a dependency that + // was aborted in a previous step, go no further. + if (!empty($context['results']['#abort'])) { return; } diff --git a/core/modules/system/src/Tests/Update/UpdatePostUpdateFailingTest.php b/core/modules/system/src/Tests/Update/UpdatePostUpdateFailingTest.php index d348b8f..0555871 100644 --- a/core/modules/system/src/Tests/Update/UpdatePostUpdateFailingTest.php +++ b/core/modules/system/src/Tests/Update/UpdatePostUpdateFailingTest.php @@ -42,13 +42,12 @@ public function testPostUpdate() { /** * {@inheritdoc} - * - * Check that all expected updates are displayed. */ protected function doSelectionTest() { + // First update, should not be run since this module's update hooks fail. $this->assertRaw('8001 - This update will fail.'); $this->assertRaw('8002 - A further update.'); - $this->assertRaw('Should not be run since there are pending updates.'); + $this->assertEscaped("First update, should not be run since this module's update hooks fail."); } } diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php index e1d69c2..6be96e1 100644 --- a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php +++ b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php @@ -154,10 +154,10 @@ public function testGetMissingUpdateList() { ], $key_value, FALSE); $expected = []; - $expected['module_a']['pending']['a'] = 'Module A update A.'; - $expected['module_a']['pending']['b'] = 'Module A update B.'; + $expected['module_a']['pending']['a'] = 'Module A update A.'; + $expected['module_a']['pending']['b'] = 'Module A update B.'; $expected['module_a']['start'] = 'a'; - $expected['module_b']['pending']['a'] = 'Module B update A.'; + $expected['module_b']['pending']['a'] = 'Module B update A.'; $expected['module_b']['start'] = 'a'; $this->assertEquals($expected, $update_registry->getMissingUpdateList()); @@ -179,9 +179,9 @@ public function testGetMissingUpdateListWithExistingUpdates() { ], $key_value, FALSE); $expected = []; - $expected['module_a']['pending']['b'] = 'Module A update B.'; + $expected['module_a']['pending']['b'] = 'Module A update B.'; $expected['module_a']['start'] = 'b'; - $expected['module_b']['pending']['a'] = 'Module B update A.'; + $expected['module_b']['pending']['a'] = 'Module B update A.'; $expected['module_b']['start'] = 'a'; $this->assertEquals($expected, $update_registry->getMissingUpdateList());