Bug 39112

Summary: Item search returns error
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: Staff interfaceAssignee: Owen Leonard <oleonard>
Status: Pushed to main --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: blocker    
Priority: P5 - low CC: gmcharlt, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39087
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 38664    
Bug Blocks:    
Attachments: Bug 39112: Fix item search results error
Bug 39112: Fix item search results error
Bug 39112: Fix item search results error
Bug 39112: Force the response on a single line

Description Caroline Cyr La Rose 2025-02-12 16:30:24 UTC
To recreate :
1. Go to Item search
2. Click 'Search'
   --> Something went wrong when loading the table. 200: OK. 
   --> No results

I also tried with homebranch = Centerville and it's the same.

If there are no results (e.g. homebranch = Fairfield), there is no message.
Comment 1 Owen Leonard 2025-02-12 17:28:03 UTC
Created attachment 177952 [details] [review]
Bug 39112: Fix item search results error

This patch updates the template which generates item search JSON (for
use by the DataTable) to add a 'collapse' FILTER around it. This
eliminates whitespace which causes the JSON to be invalid.

To test, apply the patch and perform an item search in the staff
interface. It should return results without error.

Sponsored-by: Athens County Public Libraries
Comment 2 Caroline Cyr La Rose 2025-02-12 17:32:16 UTC
Created attachment 177953 [details] [review]
Bug 39112: Fix item search results error

This patch updates the template which generates item search JSON (for
use by the DataTable) to add a 'collapse' FILTER around it. This
eliminates whitespace which causes the JSON to be invalid.

To test, apply the patch and perform an item search in the staff
interface. It should return results without error.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2025-02-12 17:32:34 UTC
Thank you Owen!
Comment 4 Jonathan Druart 2025-02-12 20:29:22 UTC
wondering if we don't have more then, see bug 39087
Comment 5 Jonathan Druart 2025-02-12 21:11:16 UTC
Created attachment 177973 [details] [review]
Bug 39112: Fix item search results error

This patch updates the template which generates item search JSON (for
use by the DataTable) to add a 'collapse' FILTER around it. This
eliminates whitespace which causes the JSON to be invalid.

To test, apply the patch and perform an item search in the staff
interface. It should return results without error.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2025-02-12 21:11:18 UTC
Created attachment 177974 [details] [review]
Bug 39112: Force the response on a single line

We don't need an empty blank line.

Might not have been caused by the tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Katrin Fischer 2025-02-13 14:32:48 UTC
Pushed for 25.05!

Well done everyone, thank you!