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

--- Comment #44 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 201615
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201615&action=edit
Bug 42386: (follow-up) Restore branch/itemtype filtering on reservesallowed

The reservesallowed count was checking ALL patron holds regardless of
branch or itemtype, breaking per-branch and per-itemtype hold limits.

The old C4::Reserves code filtered the count by:
- Branch (items.homebranch or borrowers.branchcode per ReservesControlBranch)
- Itemtype (when the matching rule was itemtype-specific)

This patch restores that behavior:
- Item::Availability::Hold retrieves the rule object to get its itemtype
- Passes rule_itemtype to Patron::Availability::Hold
- The reservesallowed count filters by control branch (when ItemHomeLibrary)
  and by rule itemtype (when the rule is itemtype-specific)

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ prove t/db_dependent/Koha/Patron/Availability/Hold.t \
       t/db_dependent/Koha/Item/Availability/Hold.t \
       t/db_dependent/Koha/Biblio/Availability/Hold.t \
       t/db_dependent/Holds.t \
       t/db_dependent/Reserves.t
=> SUCCESS: Tests pass!
3. Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to