Skip to content

Commit

Permalink
Another fix implementation of AR-Identifier-2 (NOJIRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Oct 28, 2024
1 parent 741bf73 commit 9ab8d75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/Model/Table/IdentifiersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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) {
Expand Down

0 comments on commit 9ab8d75

Please sign in to comment.