[Koha-bugs] [Bug 25408] CanBookBeReserved & CanItemBeReserved should check "opacitemholds" policy

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 31 13:15:36 CEST 2020


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

Nick Clemens <nick at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at bywatersolutions.com
             Status|Signed Off                  |Failed QA

--- Comment #20 from Nick Clemens <nick at bywatersolutions.com> ---
Needs a minor rebase

I am not sure this is the best way to go. With these patches we fetch every
item from the db and check the hold rule - but this doubles work we do in
CanItemBeReserved and feels unnecessary

Currently the loop in CanBookBeReserved returns as soon as it finds one 'OK' -
you loop over all items to check the holds policy first - I think if we return
the holds policy too from CanItemBeReserved we can return if one item is OK and
item level holds not forced. I believe this would allow removal of the caller
check too

The code on the patches returns 'RecordHoldNotAllowed' if any items have item
level holds forced, but shouldn't it only return that if all items on the
biblio are forced?

You add an extra fetch for the item which has already been fetched in the code:
429     $item = Koha::Items->find( $itemnumber );

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


More information about the Koha-bugs mailing list