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 <jason@sigio.com>
Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
}
}
} 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;
+ }
}
}