https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443

--- Comment #34 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 204940
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204940&action=edit
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 <[email protected]>
Signed-off-by: Tomás Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to