LP1537228: Display precat alert on every checkin user/sandbergja/lp1537228_display_precat_alert_on_every_checkin
authorJane Sandberg <sandbej@linnbenton.edu>
Tue, 22 May 2018 01:37:21 +0000 (18:37 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Tue, 22 May 2018 01:37:21 +0000 (18:37 -0700)
To test:
1) Create a precat item.
2) Check it in twice in the Web client.  Confirm that the alert only
appears the first time.
3) Apply this commit.
4) Repeat steps 1-2.  The alert should appear every time you check in
the item.

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index c2d5518..3f67dd1 100644 (file)
@@ -3077,14 +3077,16 @@ sub checkin_check_holds_shelf {
 
 sub checkin_handle_precat {
     my $self    = shift;
-   my $copy    = $self->copy;
+    my $copy    = $self->copy;
 
-   if( $self->is_precat and ($copy->status != OILS_COPY_STATUS_CATALOGING) ) {
-        $copy->status(OILS_COPY_STATUS_CATALOGING);
-        $self->update_copy();
-        $self->checkin_changed(1);
+    if( $self->is_precat ) {
+        if( $copy->status != OILS_COPY_STATUS_CATALOGING ) {
+            $copy->status(OILS_COPY_STATUS_CATALOGING);
+            $self->update_copy();
+            $self->checkin_changed(1);
+        }
         $self->push_events(OpenILS::Event->new('ITEM_NOT_CATALOGED'));
-   }
+    }
 }