Skip to content

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

Merged
weitzman merged 1 commit into11.xfrom
pm-enable
Oct 30, 2021
Merged

pm:enable should fail by default if hook_requirements() is not met#4874
weitzman merged 1 commit into11.xfrom
pm-enable

Conversation

@weitzman
Copy link
Member

Fixes #4754

@weitzman weitzman merged commit 5011864 into 11.x Oct 30, 2021
@weitzman weitzman deleted the pm-enable branch October 30, 2021 10:45
@simesy
Copy link
Contributor

simesy commented Jan 23, 2024

Just noting that drush will throw an error, but the caller can bypass the requirement (it's not possible to ignore the requirement in the UI).

I have a module that should never be installed on production (it creates test content) and so I throw an exception in hook_requirements 'install' phase if it's CLI on production.

@wombatbuddy
Copy link

If we run the following command: drush en -y my_module and the hook_requirements returns 'severity' => REQUIREMENT_ERROR then Drush display the error message but still enables the module.
Drush 12.5.2.0
Drupal 10.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Next milestone: pm:enable should fail by default if hook_requirements() is not met

3 participants