From b091cb1f39c0e52b4f98a4443704092af60e724c Mon Sep 17 00:00:00 2001 From: Christine Zoglmeier Date: Thu, 31 Oct 2024 13:48:56 +0100 Subject: [PATCH] [WIP] Implement suggested bugfix for duplicate key exception Related: https://projekte.in2code.de/issues/66385, Related: https://github.com/in2code-de/in2publish_core/issues/120 --- .../Core/Repository/SingleDatabaseRepository.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/Component/Core/Repository/SingleDatabaseRepository.php b/Classes/Component/Core/Repository/SingleDatabaseRepository.php index 79deee7a1..6f2d499fb 100644 --- a/Classes/Component/Core/Repository/SingleDatabaseRepository.php +++ b/Classes/Component/Core/Repository/SingleDatabaseRepository.php @@ -148,6 +148,14 @@ public function findByPropertyWithJoin( $splitRow['mmtbl']['uid_local'], $splitRow['mmtbl']['uid_foreign'], ]; + if(isset($splitRow['mmtbl']['tablenames'])) + { + $mmIdentityProperties[] = $splitRow['mmtbl']['tablenames']; + } + if(isset($splitRow['mmtbl']['fieldname'])) + { + $mmIdentityProperties[] = $splitRow['mmtbl']['fieldname']; + } $splitRows[hash('sha1', json_encode($mmIdentityProperties, JSON_THROW_ON_ERROR))] = $splitRow; } /* @@ -230,6 +238,8 @@ public function findMmByProperty(string $table, string $property, array $values) $mmIdentityProperties = [ $row['uid_local'], $row['uid_foreign'], + $row['tablenames'] ?? null, + $row['fieldname'] ?? null, ]; $rows[hash('sha1', json_encode($mmIdentityProperties, JSON_THROW_ON_ERROR))] = $row; }