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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 11 Mar 2024 09:42:34 +0000 (10:42 +0100)
commit05742ec900076e546a282fc7d7cd48f584fccf79
treef604f7d05d7354c9023abc14a35732fdd25fe403
parentc23838f24f9b40d188cd662401960d4659b78560
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>
Koha/REST/V1/Items.pm
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt