[Koha-bugs] [Bug 32702] Item statuses that block holds should be checked in CanItemBeReserved

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jan 23 17:54:08 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32702

--- Comment #1 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 145590
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145590&action=edit
Bug 32702: Move item status checks to CanItemBeReserved

This patch moves item status checks from IsAvailableForItemLevelRequest to
CanItemBeReserved.

Changes to existing calls highlighted below.

Existing Calls for CanItemBeReserved/CanBookBeReserved:
Call in Circulation.pm
checkHighHolds - previously would have allowed damaged, notforloan, etc items
to fill holds
CanBookBeRenewed - Already a combination of CanItemBeReserved and
IsAvailableForItemLevelRequest

Call in ILSDI/Services.pm
HoldItem - would have allowed placing holds on damaged/notforloan/etc items

C4/Reserves:
What is ItemsAnyAvailableAndNotRestricted used for

C4/SIP/ILS/Transaction/Hold.pm:
do_hold - would have allowed hold on lost/damaged/etc.

Koha/Club/Hold/pm:
add - would have allowed etc.

Koha/REST/V1/Holds.pm:
add - would have allowed ...

opac/opac-reserve.pl:
Was already combo of CanItemBeReserved and IsAvailableForItemLevelRequest

reserve/placerequest:
Items would have been filtered on reserve/request.pl by
IsAvailableForItemLevelRequest

In this case and opac, I believe before this a hold could have been forced with
the right parameters

Existing Calls for IsAvailableForItemLevelRequest
C4/Circulation - see above

Call in ILSDI/Services.pm:
GetServices - Already a combination of CanItemBeReserved and
IsAvailableForItemLevelRequest

Call in opac/opac-reserve.pl:
Already a combination of CanItemBeReserved and IsAvailableForItemLevelRequest

Call in reserve/request.pl:
Already a combination of CanItemBeReserved and IsAvailableForItemLevelRequest

To test:
1 - Setup a record with items to have:
    1 available item
    1 lost item
    1 item with positive not for loan status
    1 item with negative not for loan status
    1 item withdrawn
    1 item damaged
    1 item not for loan by itemtype
2 - Attempt to place hold on staff and opac and note the statuses
3 - Apply patch
4 - Confirm the statuses have not changed
5 - Attempt to hold lost/damaged/withdrawn/notforloan items via API
6 - You should not be able to place the hold
7 - Attempt to place club holds on these items - it should not be possible
8 - Attempt to place holds via ILSDI - it should not be possible

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list