Bug 36951 - ILL request searching is broken
Summary: ILL request searching is broken
Status: RESOLVED DUPLICATE of bug 36904
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low blocker (vote)
Assignee: Tomás Cohen Arazi
QA Contact:
URL:
Keywords:
Depends on: 35093
Blocks:
  Show dependency treegraph
 
Reported: 2024-05-23 15:41 UTC by Lisette Scheer
Modified: 2024-05-23 16:03 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 36951: Fix embed name mismatch batch vs. ill_batch (2.05 KB, patch)
2024-05-23 15:53 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lisette Scheer 2024-05-23 15:41:00 UTC
Bug 30719 introduced batches but when using filtering on the table an error is thrown.
Comment 1 Pedro Amorim 2024-05-23 15:47:26 UTC
(In reply to Lisette Scheer from comment #0)
> Bug 30719 introduced batches but when using filtering on the table an error
> is thrown.

Possible duplicate of bug 36904? If not please detail the test plan further.
Comment 2 Pedro Amorim 2024-05-23 15:48:53 UTC
Mid-air collision there with Tomas.
I'm setting this as 'NEW' for now if that's okay?
Comment 3 Tomás Cohen Arazi 2024-05-23 15:53:46 UTC
Created attachment 167120 [details] [review]
Bug 36951: Fix embed name mismatch batch vs. ill_batch

This patch fixes a query error on the ILL requests page.

This comes from an incomplete fix from bug 35093, which correctly
renamed the `batch` embed to `ill_batch`, but missed to change the
column `data` attribute on the DataTable.

Because of that, when doing keyword searches, the KohaTable component
generates a query on `batch.name` instead of `ill_batch.name`, which
generates a 500 error (because Koha is not returning the right status on
DB query errors).

To reproduce:
1. Have your KTD up, with some ILL backend:
   $ ktd --shell
  k$ bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2. Go to the ILL requests page
3. Perform any query on the top level filter box
=> FAIL: You get a 500. The logs say:

```
[ERROR] GET /api/v1/ill/requests: unhandled exception (Koha::Exceptions::BadParameter)<<Exception 'Koha::Exceptions::BadParameter' thrown 'Cannot find Koha::Object class for batch'>>
```

4. Apply this patch
5. Reload all the page contents (ctrl+shift+r or cmd+shift+r)
6. Repeat 3
=> SUCCESS: No error!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2024-05-23 16:03:45 UTC
Pedro, yes.

*** This bug has been marked as a duplicate of bug 36904 ***