Bug 39112 - Item search returns error
Summary: Item search returns error
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 38664
Blocks:
  Show dependency treegraph
 
Reported: 2025-02-12 16:30 UTC by Caroline Cyr La Rose
Modified: 2025-02-13 14:32 UTC (History)
2 users (show)

See Also:
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:


Attachments
Bug 39112: Fix item search results error (1.67 KB, patch)
2025-02-12 17:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39112: Fix item search results error (1.73 KB, patch)
2025-02-12 17:32 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 39112: Fix item search results error (1.81 KB, patch)
2025-02-12 21:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39112: Force the response on a single line (967 bytes, patch)
2025-02-12 21:11 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!