Skip to content

Check requirements before running updatedb#2708

Merged
weitzman merged 1 commit into
drush-ops:8.xfrom
alexpott:update_requirements
Oct 19, 2017
Merged

Check requirements before running updatedb#2708
weitzman merged 1 commit into
drush-ops:8.xfrom
alexpott:update_requirements

Conversation

@alexpott

@alexpott alexpott commented Apr 7, 2017

Copy link
Copy Markdown
Contributor

See #1427

update_fix_compatibility();

// Check requirements before updating.
if (!drush_update_check_requirements()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be a validation callback instead, so it's run before we hit the actual command? Then drush_update_check_requirements can just be used directly or the validation command can call out to that as the code is now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well then we have to go through the rigmarole of loading all the .install files in the validation

@weitzman

Copy link
Copy Markdown
Member

I get that update.php does this, but updatebd doesnt have to do everything that update.php does. updatedb lacks tests and i'm loath to put more weight on it without tests.

@alexpott

Copy link
Copy Markdown
Contributor Author

The problem is that drush will run updates when core would not.

@weitzman

weitzman commented Apr 18, 2017

Copy link
Copy Markdown
Member

Right. Some other command could validate requirements and then careful folks would chain calls to that command and then updatedb. Just saying that updatedb doesn't have to do it all.

@weitzman

Copy link
Copy Markdown
Member

Merged into 8.x and master in order to help media entity contrib project.

@marcoscano

Copy link
Copy Markdown

Thanks!

@mootari

mootari commented Oct 25, 2017

Copy link
Copy Markdown

When is the next release due?

@gideoncresswell

Copy link
Copy Markdown

This still does not work on a Drupal 7 site. The update_7.inc file runs the update_check_requirements() function but doesn't check if that returns TRUE or FALSE. And it doesn't call any hook_requirements() at all - just system_requirements().

Issue #1427 was closed in favour of this ticket, but the bug is still present.

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.

6 participants