From 44daf5422d3f1cba04bdc36df22a16890c7ba8bd Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Sat, 20 Jan 2018 10:52:55 -0500 Subject: [PATCH] Fix #3316. updatedb fails to run updates when status checks fail. --- src/Commands/core/UpdateDBCommands.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Commands/core/UpdateDBCommands.php b/src/Commands/core/UpdateDBCommands.php index c2e7ab847b..2e3299a4ed 100644 --- a/src/Commands/core/UpdateDBCommands.php +++ b/src/Commands/core/UpdateDBCommands.php @@ -40,7 +40,9 @@ public function updatedb($options = ['cache-clear' => true, 'entity-updates' => // Check requirements before updating. if (!$this->updateCheckRequirements()) { - return; + if (!$this->io()->confirm(dt('Requirements check reports errors. Do you wish to continue?'))) { + throw new UserAbortException(); + } } $return = drush_invoke_process('@self', 'updatedb:status', [], ['entity-updates' => $options['entity-updates'], 'post-updates' => $options['post-updates']]); @@ -589,7 +591,7 @@ public function entityUpdatesMain() */ public function updateCheckRequirements() { - $continue = true; + $return = true; \Drupal::moduleHandler()->resetImplementations(); $requirements = update_check_requirements(); @@ -598,7 +600,7 @@ public function updateCheckRequirements() // If there are issues, report them. if ($severity != REQUIREMENT_OK) { if ($severity === REQUIREMENT_ERROR) { - $continue = false; + $return = false; } foreach ($requirements as $requirement) { if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) { @@ -612,6 +614,6 @@ public function updateCheckRequirements() } } - return $continue; + return $return; } }