Bug 17743

Summary: Item search: indexes build on MARC do not work in item's search
Product: Koha Reporter: Zeno Tajoli <ztajoli>
Component: SearchingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: jonathan.druart, julian.maurice, kyle, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 17743: Item search - Fix indexes build on MARC
Bug 17743: Item search - Fix indexes build on MARC
Bug 17743: Item search - Fix indexes build on MARC

Description Zeno Tajoli 2016-12-08 08:38:48 UTC
In Items search(Home › Catalog › Item search ) it is possible to insert personal indexes based on MARC tags and subfields.
Those indexes are managed by Item search fields (Home › Administration › Item search fields).

But now in master indexes based on 245$c (and others tags like 260, 001, etc.) doesn't work.
If I use it, the system doesn't do any filter on data; it list all records with an item.
Comment 1 Katrin Fischer 2016-12-13 22:26:52 UTC
The same happens for fields like 952$x. I just tested on master and it also gives back all results instead of filtering.
We think this used to work sometime prior to 3.22.10.
Comment 2 Katrin Fischer 2016-12-14 20:19:02 UTC
This renders the whole configuration options useless, upping severity a bit.
Comment 3 Jonathan Druart 2016-12-16 10:41:38 UTC
Created attachment 58242 [details] [review]
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
Comment 4 Katrin Fischer 2016-12-22 13:04:58 UTC
Created attachment 58383 [details] [review]
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 <katrin.fischer.83@web.de>
Comment 5 Nick Clemens (kidclamp) 2016-12-22 13:46:47 UTC
Created attachment 58386 [details] [review]
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 <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Kyle M Hall (khall) 2016-12-22 14:10:59 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 7 Katrin Fischer 2016-12-22 19:28:09 UTC
This patch has been pushed to 16.11.x, will be in 16.11.01.
Comment 8 Julian Maurice 2017-01-02 11:56:26 UTC
Pushed to 3.22.x for 3.22.14
Comment 9 Mason James 2017-01-29 11:43:51 UTC
Pushed to 16.05.x, for 16.05.07 release