Bug 35963: Fix bundled items table ordering and filtering
authorJulian Maurice <julian.maurice@biblibre.com>
Wed, 7 Feb 2024 13:36:01 +0000 (14:36 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 19 Mar 2024 15:29:43 +0000 (15:29 +0000)
commit3538c373f69a733f3bbee323c66e401b6e2e0d61
treecc12500eeaf11b79b45d452fe5018a40bcaee72f
parentd18daa5358c8e84ded911fe9c7516b386fb6912b
Bug 35963: Fix bundled items table ordering and filtering

Using the many-to-many relationship results in the table alias `me` to
be used for table `item_bundles` instead of the expected table `items`.
This causes ordering and filtering to fail for columns Callnumber and
Barcode.
Using Koha::Items->search does not have this problem.

This patch also disables ordering by status because it does not work
(error message is: "Cannot find Koha::Object class for return_claim'")

Test plan:
1. Create an item bundle
   https://koha-community.org/manual/23.11/en/html/circulation.html#circulating-bundles
2. Add at least 2 items to this bundle
3. Verify that ordering/filtering by callnumber or barcode works
4. Run `prove t/db_dependent/api/v1/items/bundled_items.t`

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2753eec1ce8ce57afc10162936967d1f39c2b0b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 05742ec900076e546a282fc7d7cd48f584fccf79)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/REST/V1/Items.pm
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt