diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php index a07a47c8f5..c4de5df0a3 100644 --- a/core/modules/update/src/UpdateProcessor.php +++ b/core/modules/update/src/UpdateProcessor.php @@ -121,7 +121,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 844d9395fa..c5e6219af7 100644 --- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php +++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php @@ -460,12 +460,12 @@ public function testFetchTasks() { $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items'); // Try to add a project again. update_create_fetch_task($project_a); - $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($project_a); - $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items'); + $this->assertEquals(4, $queue->numberOfItems(), 'Queue contains four items'); } /** diff --git a/core/modules/update/update.install b/core/modules/update/update.install index b77654d622..b067b788dd 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(); } /**