In opac-reserve.pl there is this line: my $rule = GetBranchItemRule( $patron->branchcode, $type ); $patron->branchcode should be replaced by the result of GetReservesControlBranch Test plan: 1. Set system preferences: - Disable OPACAllowUserToChooseBranch - Set ReservesControlBranch to "item's home library" - Enable UseBranchTransferLimits - Set BranchTransferLimitsType to "item type" - Enable canreservefromotherbranches - Disable IndependantBranches 2. Create two libraries: ITEM_LIB and PATRON_LIB 3. Set circulation rules: - Remove all circulation rules (DELETE FROM circulation_rules) - Set a default rule that allow some holds and with "OPAC item level holds" = "force". Allow "on shelf" holds for easier testing. - In the rules for ITEM_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library" - set "Hold pickup library match" to "item's home library" - In the rules for PATRON_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library", - set "Hold pickup library match" to "any library" 4. In "Library transfer limits" disable all transfers from ITEM_LIB to PATRON_LIB for an item type (let's say "BOOK") 5. Create a biblio with an item: - item type must be the same as in previous step ("BOOK") - home branch and holding branch must be ITEM_LIB 6. Create a patron at PATRON_LIB, give it a password so it can log in. 7. Go to OPAC, and login with this patron 8. Try to place a hold for the new item. You should be allowed to place a hold, but when doing it, no holds will be created.
Created attachment 147426 [details] [review] Bug 33074: Take ReservesControlBranch into account in opac-reserve.pl Test plan: 1. Set system preferences: - Disable OPACAllowUserToChooseBranch - Set ReservesControlBranch to "item's home library" - Enable UseBranchTransferLimits - Set BranchTransferLimitsType to "item type" - Enable canreservefromotherbranches - Disable IndependantBranches 2. Create two libraries: ITEM_LIB and PATRON_LIB 3. Set circulation rules: - Remove all circulation rules (DELETE FROM circulation_rules) - Set a default rule that allow some holds and with "OPAC item level holds" = "force". Allow "on shelf" holds for easier testing. - In the rules for ITEM_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library" - set "Hold pickup library match" to "item's home library" - In the rules for PATRON_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library", - set "Hold pickup library match" to "any library" 4. In "Library transfer limits" disable all transfers from ITEM_LIB to PATRON_LIB for an item type (let's say "BOOK") 5. Create a biblio with an item: - item type must be the same as in previous step ("BOOK") - home branch and holding branch must be ITEM_LIB 6. Create a patron at PATRON_LIB, give it a password so it can log in. 7. Go to OPAC, and login with this patron 8. Try to place a hold for the new item. You should be allowed to place a hold, but when doing it, no holds will be created. 9. Apply patch, restart Koha 10. Try to place a hold for the new item. This time the hold should be created
Created attachment 154543 [details] [review] Bug 33074: Take ReservesControlBranch into account in opac-reserve.pl Test plan: 1. Set system preferences: - Disable OPACAllowUserToChooseBranch - Set ReservesControlBranch to "item's home library" - Enable UseBranchTransferLimits - Set BranchTransferLimitsType to "item type" - Enable canreservefromotherbranches - Disable IndependantBranches 2. Create two libraries: ITEM_LIB and PATRON_LIB 3. Set circulation rules: - Remove all circulation rules (DELETE FROM circulation_rules) - Set a default rule that allow some holds and with "OPAC item level holds" = "force". Allow "on shelf" holds for easier testing. - In the rules for ITEM_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library" - set "Hold pickup library match" to "item's home library" - In the rules for PATRON_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library", - set "Hold pickup library match" to "any library" 4. In "Library transfer limits" disable all transfers from ITEM_LIB to PATRON_LIB for an item type (let's say "BOOK") 5. Create a biblio with an item: - item type must be the same as in previous step ("BOOK") - home branch and holding branch must be ITEM_LIB 6. Create a patron at PATRON_LIB, give it a password so it can log in. 7. Go to OPAC, and login with this patron 8. Try to place a hold for the new item. You should be allowed to place a hold, but when doing it, no holds will be created. 9. Apply patch, restart Koha 10. Try to place a hold for the new item. This time the hold should be created Signed-off-by: Jessie Zairo <jzairo@bywatersolutions.com>
Very thorough testing steps.
> You should be allowed to place a hold, but when doing it, no holds will be created. I didn't get that, I got «One or more holds were not placed due to following errors: Cannot be transferred to pickup library» I double checked having setup the right config and scenario. @Julian: is that also an expected outcome? @Jessie: what did you got when testing? Other than that, the patch allows the hold to be placed so it seems to be working.
Created attachment 154992 [details] [review] Bug 33074: (QA follow-up) tidy code
Bug 30825 is PQA and it removes GetReservesControlBranch. We can still keep this patch for stable branches, but we need a new one built on top of it.
Created attachment 156094 [details] [review] Bug 33074: Use Koha::Policy::Holds->holds_control_library
Sorry, it was unfair. I PQAed bug 30825 earlier today!
Created attachment 156366 [details] [review] Bug 33074: Take ReservesControlBranch into account in opac-reserve.pl Test plan: 1. Set system preferences: - Disable OPACAllowUserToChooseBranch - Set ReservesControlBranch to "item's home library" - Enable UseBranchTransferLimits - Set BranchTransferLimitsType to "item type" - Enable canreservefromotherbranches - Disable IndependantBranches 2. Create two libraries: ITEM_LIB and PATRON_LIB 3. Set circulation rules: - Remove all circulation rules (DELETE FROM circulation_rules) - Set a default rule that allow some holds and with "OPAC item level holds" = "force". Allow "on shelf" holds for easier testing. - In the rules for ITEM_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library" - set "Hold pickup library match" to "item's home library" - In the rules for PATRON_LIB, under "Default checkout, hold and return policy", - set "Hold policy" to "From any library", - set "Hold pickup library match" to "any library" 4. In "Library transfer limits" disable all transfers from ITEM_LIB to PATRON_LIB for an item type (let's say "BOOK") 5. Create a biblio with an item: - item type must be the same as in previous step ("BOOK") - home branch and holding branch must be ITEM_LIB 6. Create a patron at PATRON_LIB, give it a password so it can log in. 7. Go to OPAC, and login with this patron 8. Try to place a hold for the new item. You should be allowed to place a hold, but when doing it, no holds will be created. 9. Apply patch, restart Koha 10. Try to place a hold for the new item. This time the hold should be created Signed-off-by: Jessie Zairo <jzairo@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> [EDIT] Merged tidy patch and switch to Koha::Policy::Holds here.
Pushed to master for 23.11. Nice work everyone, thanks!
Bug 30825 is not in 23.05.x I see old patches could be used, please attach a patch with [23.05.x] for stable backport
(In reply to Fridolin Somers from comment #11) > Bug 30825 is not in 23.05.x > I see old patches could be used, please attach a patch with [23.05.x] for > stable backport You can use the original (obsoleted) patch. It does not depend on bug 30825
Pushed to 23.05.x for 23.05.05
Dependency missing for 22.11.x - not backporting