Skip to content

Commit

Permalink
Interim sanity check for sorid changes (NOJIRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Apr 25, 2021
1 parent c4ec6f8 commit 8a8ebd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 12 additions & 3 deletions app/src/Controller/MatchgridRecordsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ public function edit($id) {
throw new \InvalidArgumentException(__('match.er.records.sorid'));
}

if($sorid != $obj->sorid) {
// As a sanity check, we don't permit the SORID to be changed, since
// MatchService does not behave consistently at the moment. (Upsert
// can't tell the row changed since we don't pass it the row ID, so it
// may create a duplicate row.) This should ultimately get fixed as
// part of CO-2138.

throw new \InvalidArgumentException(__('match.er.records.sorid.diff'));
}

unset($reqData['sor']);
unset($reqData['sorid']);
unset($reqData['matchgrid_id']);
Expand All @@ -212,9 +222,8 @@ public function edit($id) {
$MatchService->setConfig($this->cur_mg->id);

// Unlike add (which verifies no entries for sor+sorid), we don't sanity
// check on edit. Basically, we assume the Matchgrid Admin knows what they're
// doing, and if they have a use case for changing the SOR of a matchgrid
// entry, then let them do it.
// check on edit. Basically, we assume the Matchgrid Admin knows what
// they're doing.

// Instantiate the AttributeManager
$AttributeManager = new AttributeManager();
Expand Down
3 changes: 3 additions & 0 deletions app/src/Locale/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ msgstr "Match Request {0} already exists for this System of Record ID"
msgid "match.er.records.sorid"
msgstr "A System of Record ID is required"

msgid "match.er.records.sorid.diff"
msgstr "Changing the System of Record ID is not supported"

msgid "match.er.rules.unsuccessful"
msgstr "No rules successfully completed"

Expand Down

0 comments on commit 8a8ebd4

Please sign in to comment.