Try checkin before marking item discard/weed.
authorJason Stephenson <jason@sigio.com>
Sun, 8 Jul 2018 15:13:40 +0000 (11:13 -0400)
committerJason Stephenson <jason@sigio.com>
Fri, 26 Oct 2018 23:04:55 +0000 (19:04 -0400)
Modify Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm to call
try_checkin in mark_item when the api includes discard under the same
conditions as when marking an item damaged.

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm

index bad3be3..c4be222 100644 (file)
@@ -1307,9 +1307,9 @@ sub mark_item {
     my( $self, $conn, $auth, $copy_id, $args ) = @_;
     $args ||= {};
 
-    # Items must be checked in before any attempt is made to mark damaged
+    # Items must be checked in before any attempt is made to mark damaged or discard
     my $evt = try_checkin($auth, $copy_id) if
-        ($self->api_name=~ /damaged/ && $args->{handle_checkin});
+        ($self->api_name=~ /(?:damaged|discard)/ && $args->{handle_checkin});
     return $evt if $evt;
 
     my $e = new_editor(authtoken=>$auth, xact =>1);