diff --git a/app/config/schema/schema.json b/app/config/schema/schema.json index d70478c0a..e19a747ef 100644 --- a/app/config/schema/schema.json +++ b/app/config/schema/schema.json @@ -595,6 +595,7 @@ "identifier_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" }, "notnull": false }, "login": { "type": "boolean" }, "email_address_type_id": { "type": "integer", "foreignkey": { "table": "types", "column": "id" }, "notnull": false }, + "allow_empty": { "type": "boolean" }, "ordr": {} }, "indexes": { diff --git a/app/resources/locales/en_US/field.po b/app/resources/locales/en_US/field.po index 007b9c871..53a4f4a8d 100644 --- a/app/resources/locales/en_US/field.po +++ b/app/resources/locales/en_US/field.po @@ -423,6 +423,12 @@ msgstr "{0} Owners" msgid "Groups.owners_group_id" msgstr "Owners Group" +msgid "IdentifierAssignments.allow_empty" +msgstr "Allow Empty" + +msgid "IdentifierAssignments.allow_empty.desc" +msgstr "If set and the Identifier Assignment does not generate an Identifier, Pipeline processing will be allowed to continue" + msgid "IdentifierAssignments.email_address_type_id" msgstr "Email Address Type" diff --git a/app/src/Model/Table/IdentifierAssignmentsTable.php b/app/src/Model/Table/IdentifierAssignmentsTable.php index b0325c9f6..bae9fc222 100644 --- a/app/src/Model/Table/IdentifierAssignmentsTable.php +++ b/app/src/Model/Table/IdentifierAssignmentsTable.php @@ -221,7 +221,16 @@ public function assign( catch(\Exception $e) { $this->llog('debug', "Identifier '".$ia->description."' assignment failed for $entityType $entityId: " . $e->getMessage()); $ret['errors'][$ia->description] = $e->getMessage(); - $cxn->rollback(); + + if(isset($ia->allow_empty) && $ia->allow_empty) { + // Failure of this Identifier Assignment does not throw an Exception, + // but we'll report it in the error set since we don't have another place + // to put it + $this->llog('debug', "Identifier '".$ia->description."' assignment allow_empty is true, will not rollback"); + } else { + // Failure of this Identifier Assignment will cause (eg) a Pipeline to fail + $cxn->rollback(); + } } } else { $this->llog('trace', "Identifier '".$ia->description."' already assigned for $entityType $entityId"); diff --git a/app/templates/IdentifierAssignments/fields.inc b/app/templates/IdentifierAssignments/fields.inc index a7c764847..864157b9b 100644 --- a/app/templates/IdentifierAssignments/fields.inc +++ b/app/templates/IdentifierAssignments/fields.inc @@ -102,5 +102,7 @@ if($vv_action == 'add' || $vv_action == 'edit') { print $this->Field->control('group_id'); + print $this->Field->control('allow_empty'); + print $this->Field->control('ordr'); } \ No newline at end of file