Description
Kyle M Hall (khall)
2014-05-06 15:31:49 UTC
Created attachment 27984 [details] [review] Bug 12197 - Exceeding the maxreserves preference does not prevent librarian from placing the hold Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just giving a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can not forcefully place the hold Created attachment 27985 [details] [review] Bug 12197: enforce the maxreserves preference when staff members place hold requests This patch ensures that the global maxreserves preference is enforced when staff members place hold requests. For example: Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just give a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can forcefully place the hold Signed-off-by: Galen Charlton <gmc@esilibrary.com> Created attachment 27986 [details] [review] Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Kyle, note that AllowHoldPolicyOverride *does* let the operator override the global maxreserves. I think this is a reasonable interpretation of AllowHoldPolicyOverride, but if you disagree, that probably belongs on a separate bug. Setting status back to signed off. Please do not change the status to failed QA without providing an explanation. Galen, I did provide an explanation, but it collided with your post. :/ Patch works on single holds, but fails when placing multiple holds. * Create a list or do a search which results in multiple items. * Following the above test plan, check 3 items to place a hold on and place the hold. * No warning is issued, and all holds are placed. Christopher Created attachment 28493 [details] [review] Bug 12197: enforce the maxreserves preference when staff members place hold requests This patch ensures that the global maxreserves preference is enforced when staff members place hold requests. For example: Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just give a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can forcefully place the hold Signed-off-by: Galen Charlton <gmc@esilibrary.com> Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Could you rebase the patch please ? I fail to apply it on master: Applying: Bug 12197: enforce the maxreserves preference when staff members place hold requests fatal: sha1 information is lacking or useless (reserve/request.pl). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch applies cleanly for me! Please try again. Maybe you missed the dependency that has now been pushed to master? Kyle (In reply to Julian Maurice from comment #8) > Could you rebase the patch please ? I fail to apply it on master: > > Applying: Bug 12197: enforce the maxreserves preference when staff members > place hold requests > fatal: sha1 information is lacking or useless (reserve/request.pl). > Repository lacks necessary blobs to fall back on 3-way merge. > Cannot fall back to three-way merge. Hi Kyle, patch doesn't apply for me either :( Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 12197: enforce the maxreserves preference when staff members place hold requests fatal: sha1 information is lacking or useless (reserve/request.pl). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 12197: enforce the maxreserves preference when staff members place hold requests The copy of the patch that failed is found in: /home/katrin/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-12197-enforce-the-maxreserves-preference-when--f87Izr.patch Created attachment 36952 [details] [review] Bug 12197: enforce the maxreserves preference when staff members place hold requests This patch ensures that the global maxreserves preference is enforced when staff members place hold requests. For example: Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just give a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can forcefully place the hold Signed-off-by: Galen Charlton <gmc@esilibrary.com> Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Before the patch, I got Cannot place hold Too many holds: Joubu has too many holds. After: Cannot place hold Too many holds: Joubu can only place a maximum of 3 total holds. No items are available to be placed on hold I don't understand why the second message appears. Kyle, can you please look into Jonathan's last comment? Created attachment 42873 [details] [review] Bug 12197: enforce the maxreserves preference when staff members place hold requests This patch ensures that the global maxreserves preference is enforced when staff members place hold requests. For example: Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just give a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can forcefully place the hold Signed-off-by: Galen Charlton <gmc@esilibrary.com> Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton <gmc@esilibrary.com> (In reply to Jonathan Druart from comment #12) > Before the patch, I got > > Cannot place hold > Too many holds: Joubu has too many holds. > > After: > > Cannot place hold > Too many holds: Joubu can only place a maximum of 3 total holds. > No items are available to be placed on hold > > I don't understand why the second message appears. Because it is technically correct. The patron cannot place the hold because the patron has too many holds, and there are no items available because the check for item holdability fails each time because the patron has too many holds. This issue is out of scope for this bug. Bug 11250 attempts to deal with this issue. (In reply to Kyle M Hall from comment #15) > (In reply to Jonathan Druart from comment #12) > > Before the patch, I got > > > > Cannot place hold > > Too many holds: Joubu has too many holds. > > > > After: > > > > Cannot place hold > > Too many holds: Joubu can only place a maximum of 3 total holds. > > No items are available to be placed on hold > > > > I don't understand why the second message appears. > > Because it is technically correct. The patron cannot place the hold because > the patron has too many holds, and there are no items available because the > check for item holdability fails each time because the patron has too many > holds. This issue is out of scope for this bug. Bug 11250 attempts to deal > with this issue. So bug 11250 and this one should be pushed together, that's it? > So bug 11250 and this one should be pushed together, that's it?
Yes, I would agree with that.
(In reply to Kyle M Hall from comment #17) > > So bug 11250 and this one should be pushed together, that's it? > > Yes, I would agree with that. They are in conflict, could you provide dependent patches? Created attachment 42936 [details] [review] Bug 12197: enforce the maxreserves preference when staff members place hold requests This patch ensures that the global maxreserves preference is enforced when staff members place hold requests. For example: Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just give a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can forcefully place the hold Signed-off-by: Galen Charlton <gmc@esilibrary.com> Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Created attachment 43749 [details] [review] Bug 12197: enforce the maxreserves preference when staff members place hold requests This patch ensures that the global maxreserves preference is enforced when staff members place hold requests. For example: Create 3 items to place holds on. Set the circulation rule to allow 50 holds for all items. Set maxreserves to 2. Place a hold on 3 different items. On the third item, it will give a warning, but you can still place the hold. Despite what the circulation rule is set for (which is only a specific case rule), maxreserves is a global rule and should stop this from happening, not just give a warning. Test Plan: 1) Reproduce the bug by following the steps above 2) Verify the bug exists 3) Apply this patch 4) Verify the librarian cannot place the hold now 5) Enable AllowHoldPolicyOverride 6) Verify the librarian can forcefully place the hold Signed-off-by: Galen Charlton <gmc@esilibrary.com> Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Patch pushed to master. Thanks Kyle! |