Bug 27718: (bug 24488 follow-up) Hide items not holdable

After bug 24488 was merged Holds to Pull list (/cgi-bin/koha/circ/pendingreserves.pl)
doesn't respect anymore the 'holdallowed' circulation rules (we bisected it to this change).
If we look at the patch "Bug 24488: Show correct first patron details on Holds to pull"
(2285c2d657) then we can notice that previously the items that were shown in the list
must had holdallowed != 0:

Now it seems like similar circ rule check is missing in the newly rewritten Holds To Pull implementation.
(description copied from comment 0)

Test plan:
Have several pending holds
Mark some item type as not holdable in the circulation rules
Confirm that the non holdable items are no longer listed on the "Holds
to pull" view

Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-02-17 16:11:52 +01:00
parent 42e9cceebc
commit ffe5eefcbc
1 changed files with 12 additions and 1 deletions

View File

@ -131,7 +131,16 @@ sub get_items_that_can_fill {
}
);
return Koha::Items->search(
my @hold_not_allowed_itypes = Koha::CirculationRules->search(
{
rule_name => 'holdallowed',
branchcode => undef,
categorycode => undef,
rule_value => 0,
}
)->get_column('itemtype');
my $items = Koha::Items->search(
{
biblionumber => { in => \@biblionumbers },
itemlost => 0,
@ -139,8 +148,10 @@ sub get_items_that_can_fill {
notforloan => 0,
onloan => undef,
itemnumber => { -not_in => [ @branchtransfers, @waiting_holds ] },
itype => { -not_in => \@hold_not_allowed_itypes },
}
);
}
=head3 type