Skip to content
Snippets Groups Projects

Issue #3265378: Fix NoPreExistingSchemaUpdateTest when MINIMUM_SUPPORTED_PHP is used

Closed Issue #3265378: Fix NoPreExistingSchemaUpdateTest when MINIMUM_SUPPORTED_PHP is used
All threads resolved!
Closed Jess requested to merge issue/drupal-3265378:3265378-move-messages into 9.3.x
All threads resolved!
Files
6
+ 7
7
@@ -81,11 +81,6 @@ function update_system_schema_requirements() {
* Checks update requirements and reports errors and (optionally) warnings.
*/
function update_check_requirements() {
// Because this is one of the earliest points in the update process,
// detect and fix missing schema versions for modules here to ensure
// it runs on all update code paths.
_update_fix_missing_schema();
// Check requirements of all loaded modules.
$requirements = \Drupal::moduleHandler()->invokeAll('requirements', ['update']);
$requirements += update_system_schema_requirements();
@@ -110,6 +105,8 @@ function _update_fix_missing_schema() {
$module_handler = \Drupal::moduleHandler();
$enabled_modules = $module_handler->getModuleList();
$messages = [];
foreach (array_keys($enabled_modules) as $module) {
// All modules should have a recorded schema version, but when they
// don't, detect and fix the problem.
@@ -140,10 +137,13 @@ function _update_fix_missing_schema() {
}
$update_registry->setInstalledVersion($module, $last_update);
$args = ['%module' => $module, '%last_update_hook' => $module . '_update_' . $last_update . '()'];
\Drupal::messenger()->addWarning(t('Schema information for module %module was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, %last_update_hook.', $args));
\Drupal::logger('update')->warning('Schema information for module %module was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, %last_update_hook.', $args);
$message['text'] = 'Schema information for module %module was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, %last_update_hook.';
$message['args'] = $args;
$messages[] = $message;
}
}
return $messages;
}
/**
Loading