Bug 24185: Make holds page faster - Call to subroutine moved below "if"
`$on_shelf_holds` was assigned before "return .. if" but not used in that code piece, so sometimes it was useless. Moved assignment after "return .. if". Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
7ecd21a1e4
commit
edef63e5a8
|
|
@ -1241,8 +1241,6 @@ sub IsAvailableForItemLevelRequest {
|
|||
$item->withdrawn ||
|
||||
($item->damaged && !C4::Context->preference('AllowHoldsOnDamagedItems'));
|
||||
|
||||
my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
|
||||
|
||||
if ($pickup_branchcode) {
|
||||
my $destination = Koha::Libraries->find($pickup_branchcode);
|
||||
return 0 unless $destination;
|
||||
|
|
@ -1256,6 +1254,8 @@ sub IsAvailableForItemLevelRequest {
|
|||
return 0 unless $branchitemrule->{hold_fulfillment_policy} ne 'holdgroup' || $home_library->validate_hold_sibling( {branchcode => $pickup_branchcode} );
|
||||
}
|
||||
|
||||
my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
|
||||
|
||||
if ( $on_shelf_holds == 1 ) {
|
||||
return 1;
|
||||
} elsif ( $on_shelf_holds == 2 ) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue