diff --git a/app/src/Controller/MatchgridRecordsController.php b/app/src/Controller/MatchgridRecordsController.php index 07abc510e..7d92bd1c4 100644 --- a/app/src/Controller/MatchgridRecordsController.php +++ b/app/src/Controller/MatchgridRecordsController.php @@ -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 diff --git a/app/src/Lib/Match/MatchService.php b/app/src/Lib/Match/MatchService.php index 114808859..1ee5d7f74 100644 --- a/app/src/Lib/Match/MatchService.php +++ b/app/src/Lib/Match/MatchService.php @@ -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; }