From eb0c1b301e6b7914085c692fa2cbed09bc0469d9 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send each selected value as a separate parameter. Otherwise DataTables (or jQuery ?) joins all values with a comma Tested / compared with several combinations, e.g. "All libraries" vs all libraries checked. With patch result is the same (without, all libraries checked had zero result). Works as expected. Signed-off-by: Marc VĂ©ron Signed-off-by: Aleisha --- .../intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 12 +++++++++++- 1 file changed, 11 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 bc1ffb9..89b6191 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,17 @@ $('#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]').each(function () { + var value = $(this).val(); + if (Array.isArray(value)) { + for (i in value) { + params.push({ 'name': $(this).attr('name'), 'value': value[i] }); + } + } else { + params.push({ 'name': $(this).attr('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() { -- 1.7.10.4