From 9aa8bf46f6b45ebcd342c09bd3a09ae55f3dd4a8 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 7 Jan 2016 15:38:57 +0100 Subject: [PATCH] Bug 14816: Fix multiple selection in item search Send each selected value as a separate parameter. Otherwise DataTables (or jQuery ?) joins all values with a comma Signed-off-by: Owen Leonard I could not reproduce the bug when selecting multiple home libraries, but I could by selecting multiple item types or collection codes. The patch allowed those queries to complete correctly. Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher --- .../intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 15cbb91f13..09e6b84302 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -230,7 +230,12 @@ $('#results-wrapper').empty().html(results_heading + table); var params = []; - $form.find('select,input[type="text"],input[type="hidden"]').not('[disabled]').each(function () { + $form.find('select').not('[disabled]').find('option:selected').each(function () { + var name = $(this).parent('select').attr('name'); + var value = $(this).val(); + params.push({ 'name': name, 'value': value }); + }); + $form.find('input[type="text"],input[type="hidden"]').not('[disabled]').each(function () { params.push({ 'name': $(this).attr('name'), 'value': $(this).val() }); }); $form.find('input[type="radio"]:checked').each(function() { -- 2.39.5