validate thirdparty merge

This commit is contained in:
2025-03-03 20:52:05 +01:00
parent 8b334b0e5d
commit cd3b015b18
3 changed files with 42 additions and 22 deletions

View File

@@ -90,7 +90,6 @@ class ThirdpartyMergeService
$joinColumn = $meta->getSingleAssociationJoinColumnName($assoc['fieldName']);
if (ThirdParty::class === $assoc['sourceEntity'] && 'parent_id' !== $joinColumn) {
// TODO what with 'address_id' and 'civility_id'? This condition also contains columns like updatedBy_id which we want to ignore...
continue;
}
@@ -102,9 +101,7 @@ class ThirdpartyMergeService
'sql' => "UPDATE {$schemaPrefix}{$tableName} SET {$joinColumn} = :toKeep WHERE {$joinColumn} = :toDelete",
'params' => ['toKeep' => $toKeep->getId(), 'toDelete' => $toDelete->getId()],
];
}
if ($assoc['type'] === 8 && isset($assoc['joinTable'])) {
} elseif (8 === $assoc['type'] && isset($assoc['joinTable'])) {
$joinTable = $assoc['joinTable']['name'];
$joinColumn = $assoc['joinTable']['joinColumns'][0]['name'];
$queries[] = [