Bug 19690: Change comments in IsAvailableForItemLevelRequest

The term 'If any unavailable' is not very clear but it is also
very hard to find something short and better.

A next available hold is possible when at least one item is
unavailable (checked out, on order, waiting/transit hold).
A item level hold is possible when the specific item is
unavailable.

Test plan:
Read the patch. The code did not change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 56410f9c90)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Marcel de Rooy 2025-12-11 09:20:27 +01:00 committed by Jacob O'Mara
parent 4bf3d8544c
commit 4e49aa5e36
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -1551,9 +1551,9 @@ sub IsAvailableForItemLevelRequest {
my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
if ( $on_shelf_holds == 1 ) {
if ( $on_shelf_holds == 1 ) { # Allow
return 1;
} elsif ( $on_shelf_holds == 2 ) {
} elsif ( $on_shelf_holds == 2 ) { # If all unavailable
# These calculations work at the biblio level, and can be expensive
# we use the in-memory cache to avoid calling once per item when looping items on a biblio
@ -1569,7 +1569,7 @@ sub IsAvailableForItemLevelRequest {
$memory_cache->set_in_cache( $cache_key, $any_available );
return $any_available ? 0 : 1;
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved)
} else { # on_shelf_holds == 0 [If any unavailable]
return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count;
}
}