added some logging to warn in multiple open circs for a copy
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 2 Feb 2007 15:07:40 +0000 (15:07 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 2 Feb 2007 15:07:40 +0000 (15:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6847 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 427d08a..f4acc86 100644 (file)
@@ -1274,9 +1274,13 @@ sub do_checkin {
 
        # the renew code will have already found our circulation object
        unless( $self->is_renewal and $self->circ ) {
-               $self->circ(
-                       $self->editor->search_action_circulation(
-                       { target_copy => $self->copy->id, checkin_time => undef })->[0]);
+        my $circs = $self->editor->search_action_circulation(
+                       { target_copy => $self->copy->id, checkin_time => undef });
+               $self->circ($$circs[0]);
+
+        # for now, just warn if there are multiple open circs on a copy
+        $logger->warn("circulator: we have ".scalar(@$circs).
+            " open circs for copy " .$self->copy->id."!!") if @$circs > 1;
        }
 
        # if the circ is marked as 'claims returned', add the event to the list