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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0014aeaac)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Katariina Pohto 2024-05-21 16:33:52 +03:00 committed by Lucas Gass
parent 0b01cc23bd
commit 2f8d5311f1
1 changed files with 1 additions and 2 deletions

View File

@ -1059,7 +1059,6 @@
[% FOREACH biblioloo IN biblioloop %]
<input type="hidden" name="biblionumber" id="biblionumber" value="[% biblioloo.biblionumber | html %]"/>
[% UNLESS biblioloo.none_avail %]
<input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
<input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
<input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
[% END %]
@ -1122,7 +1121,7 @@
[% END %]
<td>
[% UNLESS ( biblioloo.warn ) %]
<input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
<input id="holdable_bibs" name="holdable_bibs" class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]" value="[% biblioloo.biblionumber | html %]"/>
[% END %]
</td>
<td>