Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
update system
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
25 Sep 2010 at 20:39 UTC
Updated:
7 Dec 2010 at 03:30 UTC
Jump to comment: Most recent file
update.php only invokes system_requirements(), but not any other hook_requirements() implementation.
This prevents modules from ensuring custom update requirements.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | drupal.update-requirements.7.patch | 3.71 KB | sun |
| #5 | drupal.update-requirements.5.patch | 1.04 KB | sun |
| drupal.update-requirements.0.patch | 956 bytes | sun |
Comments
Comment #1
pwolanin commentedIs there any documentation or history as to why it's this way? Or just someone forgot to fix it in D5->D6?
Comment #2
sunIt doesn't look like hook_requirements() was ever invoked for all modules. I just searched in D5's update.php, and the term "requirements" does not even appear once in there.
Note that with the patch, System module's requirements are checked twice on update.php -- once for the initial update.php bootstrap, which loads system.module only to check fundamental system requirements prior to attempting to update anything; and then once again on update.php's 'info' task/step, in which all modules are loaded for the first time.
I tested this patch by temporarily adding:
...which successfully prevented me from updating.
Comment #3
sunGiven that module requirements can heavily change when upgrading to or updating within D7, this is a pretty major bug.
Comment #4
Stevel commentedThe comment says explicitly that only system.module requirements are checked, so that should be changed as well.
As there was a comment, I went back to see where the code was introduced (#200674: Update requires PHP memory limit warning if below recommended minimum) and it seems the initial reason was just to check for the memory limit, which just happened to be in system_requirements, so no compelling reason not to check other requirements here.
Comment #5
sunThanks, fixed that comment.
Comment #6
mattyoung commentedThe documentation of hook_requirement() http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
only mention $phase == 'runtime' and 'install'. It does not have 'update'.
Comment #7
sunGood catch, thanks!
Comment #8
Stevel commentedThis looks good to go.
Comment #9
dries commentedCommitted to CVS HEAD.