Skip to content

Commit

Permalink
pm:enable should fail by default if hook_requirements() is not met (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Oct 30, 2021
1 parent 887f624 commit 5011864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Drupal/Commands/pm/PmCommands.php
Expand Up @@ -150,8 +150,8 @@ public function validateEnableModules(CommandData $commandData)
}

if ($error) {
// Let the user confirm the installation if the requirements are unmet.
if (!$this->io()->confirm(dt('The module install requirements failed. Do you wish to continue?'))) {
// Allow the user to bypass the install requirements.
if (!$this->io()->confirm(dt('The module install requirements failed. Do you wish to continue?'), false)) {
throw new UserAbortException();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/PmEnDisUnListInfoTest.php
Expand Up @@ -27,7 +27,7 @@ public function testEnDisUnList()

// Test that pm-enable does not install a module if the install
// requirements are not met.
$this->drush('pm-enable', ['drush_empty_module'], ['no' => null], null, null, self::EXIT_ERROR, null, [
$this->drush('pm-enable', ['drush_empty_module'], [], null, null, self::EXIT_ERROR, null, [
'UNISH_FAIL_INSTALL_REQUIREMENTS' => 'drush_empty_module',
]);
$err = $this->getErrorOutput();
Expand Down

0 comments on commit 5011864

Please sign in to comment.