Skip to content

Commit

Permalink
Assign Reference ID if no Potential Rules run (CO-2127)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Apr 24, 2021
1 parent dbc3e74 commit b0ac1f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/Lib/Match/MatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,17 @@ public function searchReferenceId(string $sor, string $sorid, AttributeManager $
// Next try potential matches
$potentialMatches = $this->search(ConfidenceModeEnum::Potential, $sor, $sorid, $attributes);

// The calling code generally checks to see if any rules successfully ran,
// since if there were no valid attributes or rules we treat that as an error.
// If no potential rules ran, we return the canonicalMatches result instead.
// (If no canonical rules ran, it doesn't matter which we return, but if at
// least one did, this is how we indicate at least something tried to happen.)
// See also CO-2127.

if(empty($potentialMatches->getSuccessfulRules())) {
return $canonicalMatches;
}

return $potentialMatches;
}

Expand Down

0 comments on commit b0ac1f4

Please sign in to comment.