A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled.
Created attachment 90565 [details] [review] Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled. Test Plan: 1) Enable AllowHoldPolicyOverride 2) Set up circ rules to allow for multiple item level holds on one record 3) Place an item level hold on a record 4) Note you can no longer place another item level hold for the same item you just placed an item-level hold on 5) Note you can still force holds that contravene the circ rules for any and all other reasons
Created attachment 90566 [details] [review] Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled. Test Plan: 1) Enable AllowHoldPolicyOverride 2) Set up circ rules to allow for multiple item level holds on one record 3) Place an item level hold on a record 4) Note you can force placing a second item hold on that reocrd 5) Attempt to do so, it will not actually work 6) Apply this patch 7) Note you can no longer place another item level hold for the same item you just placed an item-level hold on 8) Note you can still force holds that contravene the circ rules for any and all other reasons
*** Bug 23107 has been marked as a duplicate of this bug. ***
I'm getting an error when I try to place an item-level hold: Undefined subroutine &CGI::Compile::ROOT::home_vagrant_kohaclone_reserve_placerequest_2epl::canItemBeReserved called at /home/vagrant/kohaclone/reserve/placerequest.pl line 100
Created attachment 90754 [details] [review] Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled. Test Plan: 1) Enable AllowHoldPolicyOverride 2) Set up circ rules to allow for multiple item level holds on one record 3) Place an item level hold on a record 4) Note you can force placing a second item hold on that reocrd 5) Attempt to do so, it will not actually work 6) Apply this patch 7) Note you can no longer place another item level hold for the same item you just placed an item-level hold on 8) Note you can still force holds that contravene the circ rules for any and all other reasons
Fixed! Can you give this one another try? Thanks! (In reply to Owen Leonard from comment #4) > I'm getting an error when I try to place an item-level hold: > > Undefined subroutine > &CGI::Compile::ROOT::home_vagrant_kohaclone_reserve_placerequest_2epl:: > canItemBeReserved called at /home/vagrant/kohaclone/reserve/placerequest.pl > line 100
Created attachment 90800 [details] [review] Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled. Test Plan: 1) Enable AllowHoldPolicyOverride 2) Set up circ rules to allow for multiple item level holds on one record 3) Place an item level hold on a record 4) Note you can force placing a second item hold on that reocrd 5) Attempt to do so, it will not actually work 6) Apply this patch 7) Note you can no longer place another item level hold for the same item you just placed an item-level hold on 8) Note you can still force holds that contravene the circ rules for any and all other reasons 9) Test with record level holds 10) Test by placing multiple holds from search results
Created attachment 90802 [details] [review] Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled. Test Plan: 1) Enable AllowHoldPolicyOverride 2) Set up circ rules to allow for multiple item level holds on one record 3) Place an item level hold on a record 4) Note you can force placing a second item hold on that reocrd 5) Attempt to do so, it will not actually work 6) Apply this patch 7) Note you can no longer place another item level hold for the same item you just placed an item-level hold on 8) Note you can still force holds that contravene the circ rules for any and all other reasons 9) Test with record level holds 10) Test by placing multiple holds from search results Signed-off-by: Martha Fuerst <mfurest@hmcpl.org>
Naive question reading the diff: should not we have that check in CanItemBeReserved?
(In reply to Jonathan Druart from comment #9) > Naive question reading the diff: should not we have that check in > CanItemBeReserved? Holds overrides are only possible from the staff interface and on this page so I believe this change is sufficient to fix the regression. In the future this code could be improved and moved to modules for more testing, but this is a serious regression affecting many users and must be fixed.
Created attachment 90974 [details] [review] Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold A library appears to be able to place a second item level hold on an item a patron already has on hold if A) AllowHoldPolicyOverride is enabled and B) the circ rule allow for multple item level holds. Once the patron submits the hold requests though, the hold does not get stored in the database. Because allowing two item level holds for the same item makes no sense, we should not allow this attempt to take place, even if AllowHoldPolicyOverride is enabled. Test Plan: 1) Enable AllowHoldPolicyOverride 2) Set up circ rules to allow for multiple item level holds on one record 3) Place an item level hold on a record 4) Note you can force placing a second item hold on that reocrd 5) Attempt to do so, it will not actually work 6) Apply this patch 7) Note you can no longer place another item level hold for the same item you just placed an item-level hold on 8) Note you can still force holds that contravene the circ rules for any and all other reasons 9) Test with record level holds 10) Test by placing multiple holds from search results Signed-off-by: Martha Fuerst <mfurest@hmcpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Simple fix for a regression. Works as expected.
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.02
backported to 18.11.x for 18.11.08