From 9ab8d75a181592897ceb17ca6172d18518fcf15f Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Mon, 28 Oct 2024 07:17:24 -0400 Subject: [PATCH] Another fix implementation of AR-Identifier-2 (NOJIRA) --- app/src/Model/Table/IdentifiersTable.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/Model/Table/IdentifiersTable.php b/app/src/Model/Table/IdentifiersTable.php index 51a6a00b8..0c653d390 100644 --- a/app/src/Model/Table/IdentifiersTable.php +++ b/app/src/Model/Table/IdentifiersTable.php @@ -278,7 +278,7 @@ public function ruleUniqueIdentifier($entity, $options) { // Uniqueness constraints only apply to People and Groups // In v4 we created a txn to ensure consistency, but it looks like Cake actually - // starts a transaction, so it appears we don't actially need to do that here. + // starts a transaction, so it appears we don't need to do that here. if(!empty($entity->person_id) || !empty($entity->group_id)) { if($entity->isNew() @@ -291,7 +291,9 @@ public function ruleUniqueIdentifier($entity, $options) { // will still prevent duplicate assignment. (AR-Identifier-3) $whereClause = [ // type_id will imply CO ID, so we don't need to check it explicitly - 'type_id' => $entity->type_id + 'type_id' => $entity->type_id, + // We ignore any Identifier from an EIS when determining uniqueness + 'source_identifier_id IS NULL' ]; if(isset($type->case_insensitive) && $type->case_insensitive) {