Created attachment 160810 [details] One title unselected When you make multi-hold and unselect one or some of the titles shown in the multi-hold page and then save the holds assuming that hold is made only for the selected titles. However, holds are made for all the titles regardless of the selection.
Created attachment 160811 [details] Hold is made for all the titles even when one was unselected Hold is made for all the titles even when one title was unselected.
The process can be repeated like this: 1. Select several biblios and choose Place hold 2. Choose a patron 3. Select a pickup location for all biblios and deselect one of the checkmarks 4. Place holds and note that even the deselected holds was placed. I looked into the code and noticed that the biblionumbers passed on to placerequest.pl come from hidden input fields that have no connection to the checkmark fields. This also means that the form validation will not care about invalid information on the unchecked biblios, which results in errors at least when unchecked biblio doesn't have a pickup location set: 1. Select several biblios and click Place hold 2. Choose a patron 3. Deselect one of the biblio checkmarks and leave the pickup location empty for that biblio. 4. Place holds and end up on an error page.
Created attachment 166780 [details] [review] Bug 35771: Unselecting titles when making multi-hold does not have any effect This patch moves the holdable_bibs id and value to the checkmark input. It doesn't do the same for the club multihold (which probably should be added), and doesn't change the <input name="biblionumber"> field which lists the biblios that end up on the URL query. It might also be beneficial to change the placerequest.pl's redirect to request.pl to use the holdable_bibs list instead of the biblionumber list, so the unselected biblio wouldn't appear on request.pl page after the holds are placed Test plan: 1. Select several biblios and choose Place hold 2. Choose a patron 3. Select a pickup location for all biblios and unselect one of the checkmarks 4. Place holds and note that even the deselected holds was placed. 5. Repeat steps 1-2. 6. Leave pickup locations empty and try to place the holds. 7. Note alert: "Please make sure all selected titles have a pickup location set" 8. Uncheck one of the biblios and add pickup locations to the checked biblios. 9. Try to place the holds and note that there is no alert, and you get an error 500. 10. Apply patch. 11. Repeat steps 1,2,8 and place holds. 12. Note that there is no error 500, and while all the biblios are shown on page, only the checked biblios have a new hold placed on them.
With this patch applied I cannot place multi-hold's at all. I think we should also fix the problem of multiple ID's ( #holdable_bibs ) on the same page.
(In reply to Lucas Gass from comment #4) > With this patch applied I cannot place multi-hold's at all. > > I think we should also fix the problem of multiple ID's ( #holdable_bibs ) > on the same page. The changes worked on my test version but I don't have a completely working community version, so couldn't test there, I just did the same changes to the community file. It wouldn't be a complete fix anyway. And I did wonder about those multiple IDs myself. There's the three different input fields for each biblionumber one the page, and the checkbox one doesn't effect the others at all. Currently we've just hidden the checkboxes so people don't try to unselect them.
Created attachment 166977 [details] [review] Bug 35771: Unselecting titles when making multi-hold I had dropped out the name attribute, which might be the reason for the patch failing. New patch with the same steps as previously. Someone else should pick up on this and check the club multi-hold too, and get rid of the multiple IDs, I wont be able to work on this further.
Created attachment 167060 [details] [review] Bug 35771: Unselecting titles when making multi-hold When placing a hold on multiple biblios Place Holds page (request.pl) has checkboxes for unselecting some of the listed biblios. Removing the checkmark does not actually unselect the biblio. Clicking the Place holds button will place a hold for all the biblios on page that can be reserved. If unchecked biblio does not have a pickup location, it will get past form validation and cause an error. Test plan: 1. Select several biblios and choose Place hold 2. Choose a patron 3. Select a pickup location for all biblios and unselect one of the checkmarks 4. Place holds and note that even the deselected holds was placed. 5. Repeat steps 1-2. 6. Leave pickup locations empty and try to place the holds. 7. Note alert: "Please make sure all selected titles have a pickup location set" 8. Uncheck one of the biblios and add pickup locations to the checked biblios. 9. Try to place the holds and note that there is no alert, and you get an error 500. 10. Apply patch. 11. Repeat steps 1,2,8 and place holds. 12. Note that there is no error 500, and while all the biblios are shown on page, only the checked biblios have a new hold placed on them. Signed-off-by: David Nind <david@davidnind.com>
I've signed off as everything now seems to work as per the test plan. For items that are listed, but where the holds are not placed (where an item was unselected), the message shown is "There are no holds on this title.". Ideally, this should say something "No hold placed for this title", or something similar.
Created attachment 171259 [details] [review] Bug 35771: Unselecting titles when making multi-hold When placing a hold on multiple biblios Place Holds page (request.pl) has checkboxes for unselecting some of the listed biblios. Removing the checkmark does not actually unselect the biblio. Clicking the Place holds button will place a hold for all the biblios on page that can be reserved. If unchecked biblio does not have a pickup location, it will get past form validation and cause an error. Test plan: 1. Select several biblios and choose Place hold 2. Choose a patron 3. Select a pickup location for all biblios and unselect one of the checkmarks 4. Place holds and note that even the deselected holds was placed. 5. Repeat steps 1-2. 6. Leave pickup locations empty and try to place the holds. 7. Note alert: "Please make sure all selected titles have a pickup location set" 8. Uncheck one of the biblios and add pickup locations to the checked biblios. 9. Try to place the holds and note that there is no alert, and you get an error 500. 10. Apply patch. 11. Repeat steps 1,2,8 and place holds. 12. Note that there is no error 500, and while all the biblios are shown on page, only the checked biblios have a new hold placed on them. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Looking good!
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.06
Pushed to 23.11.x for 23.11.11