From 9e68a7d42d3d0c9c2c8961c32e3348ff4b5d5abf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 15 Dec 2016 10:47:24 +0000 Subject: [PATCH] Bug 17743: Item search - Fix indexes build on MARC Searching items by custom search fields does not work because these fields are not correctly processed in JS. In case of custom search field, the parent of the option is not the select but the optgroup element. Test plan: Create a custom search field on 245$c for instance On the items search form, select this field and launch a search => Without this patch, the results will not be filtered and you will get all your items => With this patch applied, the results should be correctly filtered Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall (cherry picked from commit c86a9e4d300fe746fe542e38a60148de6501f7a6) Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 2 +- 1 file changed, 1 insertion(+), 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 55f553eb1d..d1eb4d829b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -233,7 +233,7 @@ var params = []; $form.find('select').not(':disabled').find('option:selected').each(function () { - var name = $(this).parent('select').attr('name'); + var name = $(this).parents('select').first().attr('name'); var value = $(this).val(); params.push({ 'name': name, 'value': value }); }); -- 2.39.5