From 05bde31b181ca5b255e3423c3018ed64b4b34795 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 1 Jul 2022 14:46:26 +0000 Subject: [PATCH] Bug 31086: Prevent placing hold with no pickup location 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 Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 9e62356d58..2768d36af0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1440,8 +1440,13 @@ 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); -- 2.20.1