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 <oleonard@myacpl.org>

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 <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
This commit is contained in:
Julian Maurice 2016-01-07 15:38:57 +01:00 committed by Brendan Gallagher
parent 9550e37fc6
commit 9aa8bf46f6

View file

@ -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() {