Koha-clms/Koha/Item
Martin Renvoize dcb423b766
Bug 42443: (QA follow-up) Add DBIC relationship aliases on Branchtransfer
The REST framework resolves _order_by parameters and embed prefetches by
walking prefetch_whitelist, which is built from DBIC relationship names.
The auto-generated relationships use the FK column names (itemnumber,
frombranch, tobranch), but the API exposes them as item, from_library,
and to_library. Sorting by item.biblio.title etc. threw a 500 because
those names were not in the whitelist.

Adding belongs_to aliases below the DO NOT MODIFY line bridges the API
names to the DBIC names, matching the convention used by other Koha
schema result classes (e.g. Koha::Schema::Result::Item).

Also updates the relation methods in Koha::Item::Transfer to use the new
aliases consistently, so the accessor names line up across both layers.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:39 +00:00
..
Search Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Transfer Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Attributes.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Template.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Templates.pm Bug 42764: Fix spelling errors across the codebase 2026-06-03 16:09:04 +00:00
Transfer.pm Bug 42443: (QA follow-up) Add DBIC relationship aliases on Branchtransfer 2026-09-04 11:23:39 +00:00
Transfers.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00