Bug 31575: Missing warning for holds where AllowHoldPolicyOverride can be used to...
authorKyle Hall <kyle@bywatersolutions.com>
Fri, 16 Sep 2022 14:47:48 +0000 (10:47 -0400)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Wed, 14 Dec 2022 13:42:38 +0000 (14:42 +0100)
If some holds are overridable, and AllowHoldPolicyOverride is enabled, Koha
used to "flag" each holdable item to let librarians know the hold could not
normally be placed. In 22.05 up to current master as of this writing, no
warning is displayed.

Test Plan:
1) Set one circ rule to allow 0 holds
2) For Library A, set "Hold pickup library match" to "item's hold group"
3) Enable AllowHoldPolicyOverride
4) Set ReservesControlBranch to "item's home branch"
5) Create a record with an item for Library A, one for Library B, and one for Library C
   This should create a scenario where A's item cannot be held, and B and C's items must be overridden
6) Note you get the "Cannot place hold" but can place those holds anyway without a "warning" sign
7) Apply this patch
8) Restart all the things!
9) Reload the page, you should now see the warning icons!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30eb30b3c1b3d71aed4e63f9f230cfb36f52abe2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 124d54c9571dbe8a18a8ca247670795696370b3a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
reserve/request.pl

index 36daf35..03dc8ab 100755 (executable)
@@ -601,7 +601,7 @@ if (   ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
 
                             if ( @pickup_locations ) {
                                 $num_items_available++;
-                                $item->{available} = 1;
+                                $item->{override} = 1;
 
                                 my $default_pickup_location;