Skip to content

Commit

Permalink
Fix rematch on Reference ID deletion (CO-2132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Apr 24, 2021
1 parent 0076605 commit 244a9ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/Controller/MatchgridRecordsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ protected function performMatch(MatchService $MatchService, string $sor, string
if(!empty($refIds[0])) {
$MatchService->attachReferenceId($sor, $sorid, $AttributeManager, (string)$refIds[0]);

$this->Flash->sucess(__('match.rs.refid.matched', [(string)$refIds[0]]));
$this->Flash->success(__('match.rs.refid.matched', [(string)$refIds[0]]));
}
} else {
// Fuzzy match, we insert the record but do NOT send notification
Expand Down
4 changes: 3 additions & 1 deletion app/src/Lib/Match/MatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function assignReferenceId(string $sor, string $sorid, AttributeManager $
$referenceId = $this->generateReferenceId();
Log::write('debug', $sor . "/" . $sorid . " Generated reference ID for request: " . $referenceId);

$this->insert($sor, $sorid, $attributes, $referenceId);
// We use upsert rather than insert because a forced re-match (by blanking
// out the referenceId via the UI) will rematch on an existing row.
$this->upsert($sor, $sorid, $attributes, $referenceId);

return $referenceId;
}
Expand Down

0 comments on commit 244a9ec

Please sign in to comment.