diff --git a/app/src/Controller/MatchgridRecordsController.php b/app/src/Controller/MatchgridRecordsController.php index 7d92bd1c4..7a5734cfe 100644 --- a/app/src/Controller/MatchgridRecordsController.php +++ b/app/src/Controller/MatchgridRecordsController.php @@ -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']); @@ -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(); diff --git a/app/src/Locale/en_US/default.po b/app/src/Locale/en_US/default.po index aab03d0fe..c6efc1771 100644 --- a/app/src/Locale/en_US/default.po +++ b/app/src/Locale/en_US/default.po @@ -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"