From 42b99da59272b4dfa637401198c0eb3d86ff2a29 Mon Sep 17 00:00:00 2001 From: Daniel Melchior Date: Tue, 9 Jul 2024 19:12:02 +0200 Subject: [PATCH] [BUGFIX] ProcessQueue throws truncated incorrect decimal value (#1083) --- CHANGELOG.md | 1 + Classes/Domain/Repository/QueueRepository.php | 2 +- Tests/Functional/Domain/Repository/QueueRepositoryTest.php | 4 ++-- Tests/Functional/Fixtures/tx_crawler_queue.csv | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b85b1bc7..e7efa74ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Changed ### Fixed +* Prevent exception `Truncated incorrect DECIMAL value` in `crawler:processQueue` [@xyng](https://github.com/xyng) ### Deprecated diff --git a/Classes/Domain/Repository/QueueRepository.php b/Classes/Domain/Repository/QueueRepository.php index cfa77c115..525ad30b2 100644 --- a/Classes/Domain/Repository/QueueRepository.php +++ b/Classes/Domain/Repository/QueueRepository.php @@ -327,7 +327,7 @@ public function unsetProcessScheduledAndProcessIdForQueueEntries(array $processI $queryBuilder->expr()->eq('exec_time', $queryBuilder->createNamedParameter(0, Connection::PARAM_INT)), $queryBuilder->expr()->in( 'process_id', - $queryBuilder->createNamedParameter($processIds, ArrayParameterType::INTEGER) + $queryBuilder->createNamedParameter($processIds, ArrayParameterType::STRING) ) ) ->set('process_scheduled', '0') diff --git a/Tests/Functional/Domain/Repository/QueueRepositoryTest.php b/Tests/Functional/Domain/Repository/QueueRepositoryTest.php index 9e16a32c6..ea7fe654b 100644 --- a/Tests/Functional/Domain/Repository/QueueRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/QueueRepositoryTest.php @@ -134,7 +134,7 @@ public function countExecutedItemsByProcessReturnsInteger(): void public function countNonExecutedItemsByProcessReturnsInteger(): void { $process = new Process(); - $process->setProcessId('1007'); + $process->setProcessId('4b802fa4bd183156c47836ba9c79643b'); self::assertSame(2, $this->subject->countNonExecutedItemsByProcess($process)); } @@ -273,7 +273,7 @@ public function unsetProcessScheduledAndProcessIdForQueueEntries(): void { $unprocessedEntriesBefore = $this->subject->countAllPendingItems() - $this->subject->countAllAssignedPendingItems(); self::assertSame(5, $unprocessedEntriesBefore); - $processIds = ['1007']; + $processIds = ['4b802fa4bd183156c47836ba9c79643b']; $this->subject->unsetProcessScheduledAndProcessIdForQueueEntries($processIds); $unprocessedEntriesAfter = $this->subject->countAllPendingItems() - $this->subject->countAllAssignedPendingItems(); diff --git a/Tests/Functional/Fixtures/tx_crawler_queue.csv b/Tests/Functional/Fixtures/tx_crawler_queue.csv index 14386b544..e4a9903b0 100644 --- a/Tests/Functional/Fixtures/tx_crawler_queue.csv +++ b/Tests/Functional/Fixtures/tx_crawler_queue.csv @@ -6,9 +6,9 @@ ,1004,0,1,"asdfgh","","",0,0,"FirstConfiguration","","",0 ,1005,0,0,"asdfgh","","",10,0,"SecondConfiguration","","",0 ,1006,1006,2,"qwerty","","",0,0,"SecondConfiguration","","7b6919e533f334550b6f19034dfd2f81",123 -,1007,1007,0,"asdfgh","","",12,0,"SecondConfiguration","","",123 -,1008,1007,3,"asdfgh","","",0,0,"ThirdConfiguration","","",456 -,1009,1007,4,"asdfgh","","",0,0,"ThirdConfiguration","","",789 +,1007,"4b802fa4bd183156c47836ba9c79643b",0,"asdfgh","","",12,0,"SecondConfiguration","","",123 +,1008,"4b802fa4bd183156c47836ba9c79643b",3,"asdfgh","","",0,0,"ThirdConfiguration","","",456 +,1009,"4b802fa4bd183156c47836ba9c79643b",4,"asdfgh","","",0,0,"ThirdConfiguration","","",789 ,1015,0,5,"dvorak","","",0,12,"FirstConfiguration","","",0 ,1016,1016,16,"dvorak","","",10,1245,"ThirdConfiguration","","",0 ,1017,1017,17,"dvorak","","",20,4321,"FirstConfiguration","","",0