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

drush updb does not respect hook_requirements #1427

Closed
czigor opened this issue Jun 3, 2015 · 3 comments
Closed

drush updb does not respect hook_requirements #1427

czigor opened this issue Jun 3, 2015 · 3 comments

Comments

@czigor
Copy link

czigor commented Jun 3, 2015

On drush 7.0.0 and drupal 7 I have a module A with a hook_update_N() enabling a module B. Both enabling module B and running the rest of the updates are crucial for the further operation of module A so I created a hook_requirements checking if module B can be enabled (i.e. the module_enable() returns FALSE or not). However, running 'drush updb' ignores hook_requirements(). (Running updates from a browser does not.)

The problem is that update_check_requirements() in commands/core/drupal/update_7.inc explicitly states:
// Check the system module and update.php requirements only.

Is this by design? If so, what is the recommended way to run such updates with drush?

@DanChadwick
Copy link

I'm using drush 6.3.0 and have the above issue and another related issue.

  1. drush updatedb does not call hook_requirements the way that executing update.php via the UI does. update.php prevents the update in the presence of errors of severity REQUIREMENT_ERROR.

  2. drush updatedb further does not enable dependent modules declared in the modules.info file. The update.php script does.

Steps to reproduce:

  1. Install and enable webform 7.x-3.x. Ensure that views is NOT installed.
  2. Install the code base for webform 7.x-4.x.
  3. Run drush updatedb. Note that views is NOT installed and enabled.

Repeat with update.php. The .info file is sufficient to cause update.php to install and enable views.

If I create a requirement for views in hook_requirements, then update.php will refuse to run at step 3. drush updatedb will however execute the updates, ignoring hook_requirements.

@alexpott
Copy link
Contributor

alexpott commented Apr 7, 2017

I just noticed this today. Totally agree this is a bug.

@weitzman
Copy link
Member

Lets close in favor of #2708

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

No branches or pull requests

4 participants