Skip to content

Commit

Permalink
[WIP] Implement suggested bugfix for duplicate key exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tinzog committed Oct 31, 2024
1 parent d28f988 commit b091cb1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Classes/Component/Core/Repository/SingleDatabaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
/*
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b091cb1

Please sign in to comment.