From 4cd80df8f05ace1d0722228ebc20a1102cddea30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gardien?= Date: Wed, 19 Feb 2025 11:57:41 +0100 Subject: [PATCH] Fix ohme import when multiple payments have same ohm identifier (#11496) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RĂ©mi --- src/Repository/Contribution/PaymentRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Repository/Contribution/PaymentRepository.php b/src/Repository/Contribution/PaymentRepository.php index 35b99f3b743..34b5a7ab79a 100644 --- a/src/Repository/Contribution/PaymentRepository.php +++ b/src/Repository/Contribution/PaymentRepository.php @@ -16,12 +16,14 @@ public function __construct(ManagerRegistry $registry) public function findOneByOhmeIdentifier(string $identifier): ?Payment { - return $this->createQueryBuilder('payment') + $payments = $this->createQueryBuilder('payment') ->where('payment.ohmeId = :identifier') ->setParameter('identifier', $identifier) ->getQuery() - ->getOneOrNullResult() + ->getResult() ; + + return $payments[0] ?? null; } public function save(Payment $payment): void