Bug 24615: Make object.search helper also order by embedded columns
authorAgustin Moyano <agustinmoyano@theke.io>
Sat, 8 Feb 2020 02:54:14 +0000 (23:54 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 3 Mar 2020 09:17:43 +0000 (09:17 +0000)
commitef1d49efb5d40ad3d620bc3b8472fb33edf5a475
tree53094ad30f5e529069c86908f3680b09db637cca
parent863f129a58f2ed850b0195fe956b9951f12ae94b
Bug 24615: Make object.search helper also order by embedded columns

With this patch REST API request can order results by embedded columns.

Full path to the column must be given for it to work.
For example: If you are on biblio endpoint and you want to order by holding patron's card number you could

> GET /biblio/1?_order_by=item.holds.cardnumber HTTP/1.1
> x-koha-embed: item.holds

To test:
1. apply this patch
2. prove t/db_dependent/Koha/REST/Plugin/Objects.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/REST/Plugin/Query.pm
t/db_dependent/Koha/REST/Plugin/Objects.t