LP1950826 Return error result on contact invalidation
authorBill Erickson <berickxx@gmail.com>
Wed, 16 Mar 2022 18:22:13 +0000 (14:22 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 7 Apr 2022 14:46:50 +0000 (10:46 -0400)
If penalty creation fails, return the error/event response to the caller
instead of the editor's last event.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Christine Burns <christine.burns@bc.libraries.coop>

Open-ILS/src/perlmods/lib/OpenILS/Utils/BadContact.pm

index c8972a3..40dbe19 100644 (file)
@@ -106,7 +106,10 @@ sub mark_users_contact_invalid {
         );
 
         # FIXME: this perpetuates a bug; the patron editor UI doesn't handle these error states well
-        return $editor->die_event if $result && ref $result eq 'HASH';
+        if ($result && ref $result eq 'HASH') {
+            $editor->rollback;
+            return $result;
+        }
 
         $_->$clear_meth;
         $editor->update_actor_user($_) or return $editor->die_event;