From 4ef663669c7f74b114281c1dfea77d153f40ea04 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 6 Sep 2018 07:40:56 +0200 Subject: [PATCH] Unset transaction source so the duplicate detector keeps working. --- app/Import/Storage/ImportArrayStorage.php | 2 +- .../Import/Routine/Spectre/StageImportDataHandlerTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Import/Storage/ImportArrayStorage.php b/app/Import/Storage/ImportArrayStorage.php index b475b67bb6..76e2605347 100644 --- a/app/Import/Storage/ImportArrayStorage.php +++ b/app/Import/Storage/ImportArrayStorage.php @@ -190,7 +190,7 @@ class ImportArrayStorage */ private function getHash(array $transaction): string { - unset($transaction['importHashV2']); + unset($transaction['importHashV2'], $transaction['original-source']); $json = json_encode($transaction); if (false === $json) { /** @noinspection ForgottenDebugOutputInspection */ diff --git a/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php b/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php index a7ec36c8c8..82d11562fd 100644 --- a/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php +++ b/tests/Unit/Support/Import/Routine/Spectre/StageImportDataHandlerTest.php @@ -360,7 +360,7 @@ class StageImportDataHandlerTest extends TestCase 'piggy_bank_name' => null, 'bill_id' => null, 'bill_name' => null, - 'original-source' => sprintf('spectre-v%s', config('firefly.version')), + 'original-source' => sprintf('spectre-v%s', config('firefly.version')), // transaction data: 'transactions' => [ @@ -398,7 +398,7 @@ class StageImportDataHandlerTest extends TestCase 'piggy_bank_name' => null, 'bill_id' => null, 'bill_name' => null, - 'original-source' => sprintf('spectre-v%s', config('firefly.version')), + 'original-source' => sprintf('spectre-v%s', config('firefly.version')), // transaction data: 'transactions' => [ @@ -558,7 +558,7 @@ class StageImportDataHandlerTest extends TestCase 'piggy_bank_name' => null, 'bill_id' => null, 'bill_name' => null, - 'original-source' => sprintf('spectre-v%s', config('firefly.version')), + 'original-source' => sprintf('spectre-v%s', config('firefly.version')), // transaction data: 'transactions' => [ @@ -596,7 +596,7 @@ class StageImportDataHandlerTest extends TestCase 'piggy_bank_name' => null, 'bill_id' => null, 'bill_name' => null, - 'original-source' => sprintf('spectre-v%s', config('firefly.version')), + 'original-source' => sprintf('spectre-v%s', config('firefly.version')), // transaction data: 'transactions' => [