Bug 37369

Summary: Item search column filtering can't use descriptions
Product: Koha Reporter: Anni Rajala <anni.rajala>
Component: SearchingAssignee: Emmi Takkinen <emmi.takkinen>
Status: Pushed to oldoldstable --- QA Contact: Lucas Gass (lukeg) <lucas>
Severity: normal    
Priority: P5 - low CC: emmi.takkinen, fridolin.somers, kebliss, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37249
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:
Attachments: Bug 37369: Fix filtering of search result table in item search
Bug 37369: Fix filtering of search result table in item search
Bug 37369: Fix filtering of search result table in item search

Description Anni Rajala 2024-07-16 09:48:18 UTC
At the moment, the filtering on item results page requires using the code in the following fields:
- Collection
- Home library
- Current library
- Shelving location
- Itemtype
- item status -fields (not for loan etc)

So e.g. "Centerville" in Home library -field doesn't bring back results but code "CPL" does. However, the user might not have a clue what the codes are so instead of codes, it should be possible to use descriptions in the filters.

This issue has previously been mentioned in bugs https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37249 and https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37238, but I couldn't find a bug that would particularly concern this problem.
Comment 1 Emmi Takkinen 2024-09-12 11:10:43 UTC
Setting importance of this as "Normal" since it's significantly affecting the usability of item search table.
Comment 2 Emmi Takkinen 2024-09-25 12:09:08 UTC
I think I found the solution to this. When item search result table is build, function columnFilter receives option "columns". It should be "aoColumns" like it was in version 23.
Comment 3 Emmi Takkinen 2024-09-26 06:47:47 UTC
Created attachment 171960 [details] [review]
Bug 37369: Fix filtering of search result table in item search

At the moment, the filtering on item results page
requires using the code in the following fields:
- Collection
- Home library
- Current library
- Shelving location
- Itemtype
- item status -fields (not for loan etc)

So e.g. "Centerville" in Home library -field doesn't
bring back results but code "CPL" does. This happens
because "columns" option in search results table
isn't working when its used in function columnFilter.
However option "aoColumns" works.

To test:
1. Navigate to item search and search items.
=> Note that all filters in search result table
are free text fields.
2. Attempt to filter search results by home library
with description of some library.
=> No results are displayed.
3. Now filter results with code of the library.
=> Results are now displayed.
4. Apply this patch and refresh page.
5. Search items again.
=> Note that now some of the filters are now using
dropdown select fields.
6. Attempt to filter results by home library again.
=> Results are now displayed correctly.

Sponsored-by: Koha-Suomi Oy
Comment 4 Olivier Hubert 2024-09-26 15:43:55 UTC
Created attachment 171991 [details] [review]
Bug 37369: Fix filtering of search result table in item search

At the moment, the filtering on item results page
requires using the code in the following fields:
- Collection
- Home library
- Current library
- Shelving location
- Itemtype
- item status -fields (not for loan etc)

So e.g. "Centerville" in Home library -field doesn't
bring back results but code "CPL" does. This happens
because "columns" option in search results table
isn't working when its used in function columnFilter.
However option "aoColumns" works.

To test:
1. Navigate to item search and search items.
=> Note that all filters in search result table
are free text fields.
2. Attempt to filter search results by home library
with description of some library.
=> No results are displayed.
3. Now filter results with code of the library.
=> Results are now displayed.
4. Apply this patch and refresh page.
5. Search items again.
=> Note that now some of the filters are now using
dropdown select fields.
6. Attempt to filter results by home library again.
=> Results are now displayed correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Olivier Hubert <olivier.hubert@inlibro.com>
Comment 5 Lucas Gass (lukeg) 2024-09-26 16:12:27 UTC
This changes filter behavior from free text to select dropdown but I suspect that is what is intended with "{ 'type': 'select', 'values':..."


Passing QA here
Comment 6 Lucas Gass (lukeg) 2024-09-26 16:14:00 UTC
Created attachment 171997 [details] [review]
Bug 37369: Fix filtering of search result table in item search

At the moment, the filtering on item results page
requires using the code in the following fields:
- Collection
- Home library
- Current library
- Shelving location
- Itemtype
- item status -fields (not for loan etc)

So e.g. "Centerville" in Home library -field doesn't
bring back results but code "CPL" does. This happens
because "columns" option in search results table
isn't working when its used in function columnFilter.
However option "aoColumns" works.

To test:
1. Navigate to item search and search items.
=> Note that all filters in search result table
are free text fields.
2. Attempt to filter search results by home library
with description of some library.
=> No results are displayed.
3. Now filter results with code of the library.
=> Results are now displayed.
4. Apply this patch and refresh page.
5. Search items again.
=> Note that now some of the filters are now using
dropdown select fields.
6. Attempt to filter results by home library again.
=> Results are now displayed correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Olivier Hubert <olivier.hubert@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Martin Renvoize (ashimema) 2024-09-30 14:34:10 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 8 Lucas Gass (lukeg) 2024-11-18 22:26:29 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 9 Fridolin Somers 2024-12-06 11:36:14 UTC
Pushed to 23.11.x for 23.11.11