Skip to content

Commit

Permalink
Fix handling of Reference Identifiers on Pipeline Match (CFM-500)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Jan 10, 2026
1 parent 7b6d1a0 commit 2bb92fe
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions app/src/Model/Table/PipelinesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,21 +652,26 @@ public function execute(
// Perform some record keeping if a new Reference Identifier was assigned

if(!empty($newReferenceId) && ($newReferenceId !== $origReferenceId)) {
// Attach the Reference Identifier to the Person. Where we're creating a
// new Person, there won't be much else on the Person record at this point,
// but that will change quickly at step (4).

$Identifiers = TableRegistry::getTableLocator()->get('Identifiers');

$rid = $Identifiers->newEntity([
'identifier' => $newReferenceId,
'person_id' => $person->id,
'type_id' => $Identifiers->Types->getTypeId($eis->co_id, 'Identifiers.type', 'reference'),
'login' => false,
'status' => SuspendableStatusEnum::Active
]);

$Identifiers->saveOrFail($rid);
if($personInfo['status'] == 'created') {
// Attach the Reference Identifier to the Person. Where we're creating a
// new Person, there won't be much else on the Person record at this point,
// but that will change quickly at step (4).

$Identifiers = TableRegistry::getTableLocator()->get('Identifiers');

$rid = $Identifiers->newEntity([
'identifier' => $newReferenceId,
'person_id' => $person->id,
'type_id' => $Identifiers->Types->getTypeId($eis->co_id, 'Identifiers.type', 'reference'),
'login' => false,
'status' => SuspendableStatusEnum::Active
]);

$Identifiers->saveOrFail($rid);
}
// else we've matched an existing Person, so by definition the Reference Identifier
// is already on the Person record (and if we try to resave it we'll violate
// AR-Identifier-2).

// We can now also record Reference ID history

Expand Down

0 comments on commit 2bb92fe

Please sign in to comment.