Commit 729a23e1 authored by Dries's avatar Dries

- Patch #922788 by sun: update.php does not invoke hook_requirements()('update') in all modules.

parent 7aab0ab3
......@@ -2692,7 +2692,8 @@ function hook_file_url_alter(&$uri) {
}
}
}
/**
/**
* Check installation requirements and do status reporting.
*
* This hook has two closely related uses, determined by the $phase argument:
......@@ -2726,24 +2727,25 @@ function hook_file_url_alter(&$uri) {
* result in a notice on the the administration overview page.
*
* @param $phase
* The phase in which hook_requirements is run:
* - 'install': the module is being installed.
* - 'runtime': the runtime requirements are being checked and shown on the
* status report page.
* The phase in which requirements are checked:
* - install: The module is being installed.
* - update: The module is enabled and update.php is run.
* - runtime: The runtime requirements are being checked and shown on the
* status report page.
*
* @return
* A keyed array of requirements. Each requirement is itself an array with
* the following items:
* - 'title': the name of the requirement.
* - 'value': the current value (e.g. version, time, level, ...). During
* install phase, this should only be used for version numbers, do not set
* it if not applicable.
* - 'description': description of the requirement/status.
* - 'severity': the requirement's result/severity level, one of:
* - REQUIREMENT_INFO: For info only.
* - REQUIREMENT_OK: The requirement is satisfied.
* - REQUIREMENT_WARNING: The requirement failed with a warning.
* - REQUIREMENT_ERROR: The requirement failed with an error.
* - title: The name of the requirement.
* - value: The current value (e.g., version, time, level, etc). During
* install phase, this should only be used for version numbers, do not set
* it if not applicable.
* - description: The description of the requirement/status.
* - severity: The requirement's result/severity level, one of:
* - REQUIREMENT_INFO: For info only.
* - REQUIREMENT_OK: The requirement is satisfied.
* - REQUIREMENT_WARNING: The requirement failed with a warning.
* - REQUIREMENT_ERROR: The requirement failed with an error.
*/
function hook_requirements($phase) {
$requirements = array();
......
......@@ -308,8 +308,8 @@ function update_extra_requirements($requirements = NULL) {
* Check update requirements and report any errors.
*/
function update_check_requirements() {
// Check the system module and update.php requirements only.
$requirements = module_invoke('system', 'requirements', 'update');
// Check requirements of all loaded modules.
$requirements = module_invoke_all('requirements', 'update');
$requirements += update_extra_requirements();
$severity = drupal_requirements_severity($requirements);
......@@ -398,6 +398,9 @@ function update_check_requirements() {
update_fix_compatibility();
// Check the update requirements for all modules.
update_check_requirements();
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
// update.php ops.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment