]> git.koha-community.org Git - koha.git/commit
Bug 31112: CanBookBeRenewed: take into account patrons with more than 1 hold to a...
authorJoonas Kylmälä <joonas.kylmala@iki.fi>
Mon, 18 Jul 2022 16:29:06 +0000 (16:29 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 31 Oct 2022 17:41:19 +0000 (17:41 +0000)
commitc6c9fba7bb769509c329279afd0f98569f8dc262
tree8fdbd1834078119cfb3ffc264ceccb3340d03196
parent2d9d66beb8d5d7980c4f03d15dd69150969b18aa
Bug 31112: CanBookBeRenewed: take into account patrons with more than 1 hold to a biblio

If a single patron had more than 1 hold to a biblio and there was only one
available item we allowed incorrectly renewing the checkout when
AllowRenewalIfOtherItemsAvailable was set to "Allow". This
changes CanBookBeRenewed so that it makes sure all the holds are
filled and not just one per patron.

To test:
 1) prove t/db_dependent/Circulation.t
 2) (Optional, as unit test is provided)
    - Set AllowRenewalIfOtherItemsAvailable = Allow
    - Create biblio with three items
    - Checkout one item to patron A
    - Add two biblio-level holds for patron B
    - Try to renew patron A's checkout with and without this patch.
    - Notice that without this patch the renewal succeeds even though we
      one unfilled hold left. After applying the patch the renewal should
      fail.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 15f622ecc1b3d425bf460527398975447cbee62e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Circulation.pm
t/db_dependent/Circulation.t