Skip to content

Commit

Permalink
Fix #3316. updatedb fails to run updates when status checks fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Jan 20, 2018
1 parent 9e0ec0a commit 44daf54
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Commands/core/UpdateDBCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']]);
Expand Down Expand Up @@ -589,7 +591,7 @@ public function entityUpdatesMain()
*/
public function updateCheckRequirements()
{
$continue = true;
$return = true;

\Drupal::moduleHandler()->resetImplementations();
$requirements = update_check_requirements();
Expand All @@ -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) {
Expand All @@ -612,6 +614,6 @@ public function updateCheckRequirements()
}
}

return $continue;
return $return;
}
}

0 comments on commit 44daf54

Please sign in to comment.