Bug 31086: Prevent placing hold with no pickup location
authorNick Clemens <nick@bywatersolutions.com>
Fri, 1 Jul 2022 14:46:26 +0000 (14:46 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 22 Jul 2022 17:19:17 +0000 (14:19 -0300)
To test:
1 - Apply patch
2 - Repeat test on previous patch
3 - You should get a warning popup when attempting to save hold
4 - Reload page
5 - Inspect the HTML and manualy set #pickup value of selected option to ""
6 - Attempt to save hold
7 - You get the popup
8 - Place a hold normally (with location) and verify it works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt

index ece6c71..3a8b790 100644 (file)
                 else {
                     msg = (_("- Please select an item to place a hold") + "\n");
                 }
+            } else {
+                if( $("#pickup").length < 1 || $("#pickup").val() == "" ){
+                    msg = _("- Please select a pickup location for this hold" + "\n");
+                }
             }
 
+
             if (msg == "") {
                 $('#hold-request-form').preventDoubleFormSubmit();
                 return(true);