From b442a17ad26a34d35197079e1f12128773f1ae81 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 22 Nov 2016 14:35:58 -0500 Subject: [PATCH] LP 1473054: No-op Checkin Should Not Always Float a Floating Copy. Prior to this patch, a no-op checkin would not check if a copy should float using the evergreen.can_float() function. It would simply float the copy to the org_unit where the checkin happened if the copy had a float value set. This commit changes the behavior to use evergreen.can_float() to determine if the copy should float to the org_unit where the checkin happened. This change makes the behavior consistent with a regular checkin. Signed-off-by: Jason Stephenson Signed-off-by: Josh Stompro Signed-off-by: Galen Charlton --- .../lib/OpenILS/Application/Circ/Circulate.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 8daab0cb9e..ad6fff2c91 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -2605,10 +2605,22 @@ sub do_checkin { } } } else { # no-op checkin - if ($U->is_true( $self->copy->floating )) { # XXX floating items still stick where they are even with no-op checkin? - $self->checkin_changed(1); - $self->copy->circ_lib( $self->circ_lib ); - $self->update_copy; + if ($self->copy->floating) { # XXX floating items still stick where they are even with no-op checkin? + my $res = $self->editor->json_query( + { + from => [ + 'evergreen.can_float', + $self->copy->floating->id, + $self->copy->circ_lib, + $self->circ_lib + ] + } + ); + if ($res && @$res && $U->is_true($res->[0]->{'evergreen.can_float'})) { + $self->checkin_changed(1); + $self->copy->circ_lib( $self->circ_lib ); + $self->update_copy; + } } } -- 2.11.0