If you select multiple values from the pulldown for a give field ( e.g. home library ), the search will never return results. I believe this issue is due to the fact that the query is using IN but is treating the entire list of values for the IN as a single string to be quoted, instead of a list of comma separated string to be quoted individually. 'str' => '(homebranch IN (?))' 'args' => 'CPL,FFL,FPL,FRL,IPT,LPL,MPL,MY,PVL,RPL,SPL,TPL,UPL'
Created attachment 46395 [details] [review] 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
Created attachment 46436 [details] [review] 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 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 <veron@veron.ch>
Created attachment 46504 [details] [review] 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 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 <veron@veron.ch> Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Julian, I'd suggest to simplify with something like: $form.find('select').not('[disabled]').find('option:selected').each(function () { I have tried and it seems to work, please confirm.
Created attachment 49952 [details] [review] 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
(In reply to Jonathan Druart from comment #4) > Julian, > I'd suggest to simplify with something like: > > $form.find('select').not('[disabled]').find('option:selected').each(function > () { > > I have tried and it seems to work, please confirm. Yep, much better, thanks. I removed the signoffs (sorry Marc and Aleisha), so I reset status to Needs signoff
Created attachment 49960 [details] [review] [SIGNED-OFF] 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.
Created attachment 49977 [details] [review] 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>
Pushed to Master - Should be in the May 2016 Release. Thanks!
Patch pushed to 3.22.x, will be in 3.22.6
Pushed to 3.22.x, will be in 3.20.11.