Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm:enable should fail by default if hook_requirements() is not met #4874

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Drupal/Commands/pm/PmCommands.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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