Skip to content
Snippets Groups Projects
Verified Commit 64e5e002 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3324995 by claudiu.cristea, GaëlG, dajjen: hook_requirements_alter() is...

Issue #3324995 by claudiu.cristea, GaëlG, dajjen: hook_requirements_alter() is not invoked on update
parent 0f891c58
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,7 @@ function update_check_requirements() { ...@@ -52,6 +52,7 @@ function update_check_requirements() {
// Check requirements of all loaded modules. // Check requirements of all loaded modules.
$requirements = \Drupal::moduleHandler()->invokeAll('requirements', ['update']); $requirements = \Drupal::moduleHandler()->invokeAll('requirements', ['update']);
\Drupal::moduleHandler()->alter('requirements', $requirements);
$requirements += update_system_schema_requirements(); $requirements += update_system_schema_requirements();
return $requirements; return $requirements;
} }
......
...@@ -28,7 +28,7 @@ function update_script_test_requirements($phase) { ...@@ -28,7 +28,7 @@ function update_script_test_requirements($phase) {
$requirements['update_script_test'] = [ $requirements['update_script_test'] = [
'title' => 'Update script test', 'title' => 'Update script test',
'value' => 'Error', 'value' => 'Error',
'description' => 'This is a requirements error provided by the update_script_test module.', 'description' => 'This is a (buggy description fixed in update_script_test_requirements_alter()) requirements error provided by the update_script_test module.',
'severity' => REQUIREMENT_ERROR, 'severity' => REQUIREMENT_ERROR,
]; ];
break; break;
...@@ -38,6 +38,15 @@ function update_script_test_requirements($phase) { ...@@ -38,6 +38,15 @@ function update_script_test_requirements($phase) {
return $requirements; return $requirements;
} }
/**
* Implements hook_requirements_alter().
*/
function update_script_test_requirements_alter(array &$requirements): void {
if (isset($requirements['update_script_test']) && $requirements['update_script_test']['severity'] === REQUIREMENT_ERROR) {
$requirements['update_script_test']['description'] = 'This is a requirements error provided by the update_script_test module.';
}
}
/** /**
* Implements hook_update_last_removed(). * Implements hook_update_last_removed().
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment