LP#1694529 Claims never checked out updates patron last-xact-id
authorBill Erickson <berickxx@gmail.com>
Thu, 29 Jun 2017 21:53:33 +0000 (17:53 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 7 Aug 2017 14:54:39 +0000 (10:54 -0400)
Force an upate to the user last_xact_id value when marking an item claims
never checked out, since the process results in patron record changes.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 21b875d..ce05bc0 100644 (file)
@@ -290,6 +290,16 @@ sub run_method {
 
     } else {
 
+        # checkin and reservation return can result in modifications to
+        # actor.usr.claims_never_checked_out_count without also modifying
+        # actor.last_xact_id.  Perform a no-op update on the patron to
+        # force an update to last_xact_id.
+        if ($circulator->claims_never_checked_out && $circulator->patron) {
+            $circulator->editor->update_actor_user(
+                $circulator->editor->retrieve_actor_user($circulator->patron->id))
+                or return $circulator->editor->die_event;
+        }
+
         $circulator->editor->commit;
     }