From ee4d523aa498e6b8bb7c59f111208cdaf6caabd0 Mon Sep 17 00:00:00 2001 From: Frank Ebbers Date: Sat, 12 Jun 2021 20:25:45 +0200 Subject: [PATCH 1/2] Used 2920285-23.patch as base for the Merge Request. --- core/modules/update/src/UpdateProcessor.php | 2 +- .../update/tests/src/Functional/UpdateSemverCoreTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php index 1e2cfb7432f..fe23040f8b4 100644 --- a/core/modules/update/src/UpdateProcessor.php +++ b/core/modules/update/src/UpdateProcessor.php @@ -115,7 +115,7 @@ public function createFetchTask($project) { if (empty($this->fetchTasks)) { $this->fetchTasks = $this->fetchTaskStore->getAll(); } - if (empty($this->fetchTasks[$project['name']])) { + if (empty($this->fetchTasks[$project['name']]) || $this->fetchTasks[$project['name']] !== $project) { $this->fetchQueue->createItem($project); $this->fetchTaskStore->set($project['name'], $project); $this->fetchTasks[$project['name']] = REQUEST_TIME; diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php index d0708ffca8c..491ea131a60 100644 --- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php +++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php @@ -427,12 +427,12 @@ public function testFetchTasks() { $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items'); // Try to add a project again. update_create_fetch_task($projecta); - $this->assertEquals(2, $queue->numberOfItems(), 'Queue still contains two items'); + $this->assertEquals(3, $queue->numberOfItems(), 'Queue still contains three items'); // Clear storage and try again. update_storage_clear(); update_create_fetch_task($projecta); - $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items'); + $this->assertEquals(4, $queue->numberOfItems(), 'Queue contains four items'); } /** -- GitLab From 7fa2cf3f1187744641ede3f807e6b05fc3616c62 Mon Sep 17 00:00:00 2001 From: Frank Ebbers Date: Sat, 12 Jun 2021 20:41:50 +0200 Subject: [PATCH 2/2] Added \Drupal::keyValue('update_fetch_task')->deleteAll(); to update_uninstall() --- core/modules/update/update.install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/update/update.install b/core/modules/update/update.install index 4c4fdc1633b..810c298d17b 100644 --- a/core/modules/update/update.install +++ b/core/modules/update/update.install @@ -87,6 +87,8 @@ function update_uninstall() { $queue = \Drupal::queue('update_fetch_tasks'); $queue->deleteQueue(); + + \Drupal::keyValue('update_fetch_task')->deleteAll(); } /** -- GitLab