diff --git a/src/Form/UpdateReady.php b/src/Form/UpdateReady.php index d8df87994eb63a9297877decdaf9b195e9dd2346..024fb590e124fdbc017dcc8366457f4911186ab1 100644 --- a/src/Form/UpdateReady.php +++ b/src/Form/UpdateReady.php @@ -6,7 +6,6 @@ use Drupal\automatic_updates\BatchProcessor; use Drupal\automatic_updates\Updater; use Drupal\automatic_updates\Validation\ReadinessTrait; use Drupal\package_manager\ValidationResult; -use Drupal\package_manager\Validator\StagedDBUpdateValidator; use Drupal\Core\Batch\BatchBuilder; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Form\FormBase; @@ -55,13 +54,6 @@ final class UpdateReady extends FormBase { */ protected $moduleList; - /** - * The staged database update validator service. - * - * @var \Drupal\package_manager\Validator\StagedDBUpdateValidator - */ - protected $stagedDatabaseUpdateValidator; - /** * The renderer service. * @@ -87,19 +79,16 @@ final class UpdateReady extends FormBase { * The state service. * @param \Drupal\Core\Extension\ModuleExtensionList $module_list * The module list service. - * @param \Drupal\package_manager\Validator\StagedDBUpdateValidator $staged_database_update_validator - * The staged database update validator service. * @param \Drupal\Core\Render\RendererInterface $renderer * The renderer service. * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher * Event dispatcher service. */ - public function __construct(Updater $updater, MessengerInterface $messenger, StateInterface $state, ModuleExtensionList $module_list, StagedDBUpdateValidator $staged_database_update_validator, RendererInterface $renderer, EventDispatcherInterface $event_dispatcher) { + public function __construct(Updater $updater, MessengerInterface $messenger, StateInterface $state, ModuleExtensionList $module_list, RendererInterface $renderer, EventDispatcherInterface $event_dispatcher) { $this->updater = $updater; $this->setMessenger($messenger); $this->state = $state; $this->moduleList = $module_list; - $this->stagedDatabaseUpdateValidator = $staged_database_update_validator; $this->renderer = $renderer; $this->eventDispatcher = $event_dispatcher; } @@ -120,7 +109,6 @@ final class UpdateReady extends FormBase { $container->get('messenger'), $container->get('state'), $container->get('extension.list.module'), - $container->get('package_manager.validator.staged_database_updates'), $container->get('renderer'), $container->get('event_dispatcher') ); @@ -144,23 +132,6 @@ final class UpdateReady extends FormBase { $messages = []; - // If there are any installed extensions with database updates in the - // staging area, warn the user that they might be sent to update.php once - // the staged changes have been applied. - $pending_updates = $this->stagedDatabaseUpdateValidator->getExtensionsWithDatabaseUpdates($this->updater); - if ($pending_updates) { - natcasesort($pending_updates); - $message_item_list = [ - '#theme' => 'item_list', - '#prefix' => '<p>' . $this->t('Possible database updates were detected in the following extensions; you may be redirected to the database update page in order to complete the update process.') . '</p>', - '#items' => $pending_updates, - '#context' => [ - 'list_style' => 'automatic-updates__pending-database-updates', - ], - ]; - $messages[MessengerInterface::TYPE_WARNING][] = $this->renderer->renderRoot($message_item_list); - } - try { $staged_core_packages = $this->updater->getStageComposer() ->getCorePackages(); diff --git a/tests/src/Functional/UpdaterFormTest.php b/tests/src/Functional/UpdaterFormTest.php index fbedae923750d36e47abe4319da2aa29ad281b04..6c3cf7ed8f932c21c178ffa98147ea713ccbcebe 100644 --- a/tests/src/Functional/UpdaterFormTest.php +++ b/tests/src/Functional/UpdaterFormTest.php @@ -566,14 +566,9 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { // Ensure that a list of pending database updates is visible, along with a // short explanation, in the warning messages. - $possible_update_message = 'Possible database updates were detected in the following extensions; you may be redirected to the database update page in order to complete the update process.'; - $warning_messages = $assert_session->elementExists('xpath', '//div[@data-drupal-messages]//div[@aria-label="Warning message"]'); - $this->assertStringContainsString($possible_update_message, $warning_messages->getText()); - $pending_updates = $warning_messages->findAll('css', 'ul.item-list__automatic-updates__pending-database-updates li'); - $this->assertCount(2, $pending_updates); - $this->assertSame('Automatic Updates Theme With Updates', $pending_updates[0]->getText()); - $this->assertSame('System', $pending_updates[1]->getText()); - + $possible_update_message = 'Possible database updates have been detected in the following extensions.<ul><li>System</li><li>Automatic Updates Theme With Updates</li></ul>'; + $warning_messages = $assert_session->elementExists('css', 'div[data-drupal-messages] div[aria-label="Warning message"]'); + $this->assertStringContainsString($possible_update_message, $warning_messages->getHtml()); if ($maintenance_mode_on === TRUE) { $assert_session->fieldNotExists('maintenance_mode'); }