diff --git a/core/includes/update.inc b/core/includes/update.inc index f7baaf5..abaa2b1 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -228,8 +228,8 @@ function update_do_one($module, $number, $dependency_map, &$context) { function update_invoke_post_update($function, &$context) { $ret = []; - // If this update was aborted in a previous step, or has a dependency that - // was aborted in a previous step, go no further. + // If this update was aborted in a previous step, or has a dependency that was + // aborted in a previous step, go no further. if (!empty($context['results']['#abort'])) { return; } diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index f939c03..92bdb80 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -13,7 +13,6 @@ use Drupal\Core\DrupalKernelInterface; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\FieldableEntityInterface; -use Drupal\Core\Update\UpdateRegistry; /** * Default implementation of the module installer. diff --git a/core/modules/system/system.install b/core/modules/system/system.install index d4eb139..3530453 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -598,14 +598,13 @@ function system_requirements($phase) { ); // Check installed modules. + $has_pending_updates = FALSE; foreach (\Drupal::moduleHandler()->getModuleList() as $module => $filename) { $updates = drupal_get_schema_versions($module); if ($updates !== FALSE) { $default = drupal_get_installed_schema_version($module); if (max($updates) > $default) { - $requirements['update']['severity'] = REQUIREMENT_ERROR; - $requirements['update']['value'] = t('Out of date'); - $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the database update script immediately.', array('@update' => \Drupal::url('system.db_update'))); + $has_pending_updates = TRUE; break; } } @@ -615,12 +614,16 @@ function system_requirements($phase) { $post_update_registry = \Drupal::service('update.post_update_registry'); $missing_post_update_functions = $post_update_registry->getPendingUpdateFunctions(); if (!empty($missing_post_update_functions)) { - $requirements['update']['severity'] = REQUIREMENT_ERROR; - $requirements['update']['value'] = t('Out of date'); - $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the database update script immediately.', array('@update' => \Drupal::url('system.db_update'))); + $has_pending_updates = TRUE; } } + if ($has_pending_updates) { + $requirements['update']['severity'] = REQUIREMENT_ERROR; + $requirements['update']['value'] = t('Out of date'); + $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the database update script immediately.', array('@update' => \Drupal::url('system.db_update'))); + } + // Verify that no entity updates are pending after running every DB update. if (!isset($requirements['update']['severity']) && \Drupal::entityDefinitionUpdateManager()->needsUpdates()) { $requirements['entity_update'] = array(