Summary: | Add support for ordering by related object columns in the REST API | ||
---|---|---|---|
Product: | Koha | Reporter: | Agustín Moyano <agustinmoyano> |
Component: | REST API | Assignee: | Agustín Moyano <agustinmoyano> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | 1joynelson, david, martin.renvoize, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00
|
|
Circulation function: | |||
Bug Depends on: | 24502 | ||
Bug Blocks: | 24561 | ||
Attachments: |
Bug 24615: Make object.search helper also order by embedded columns
Bug 24615: Make object.search helper also order by embedded columns Bug 24615: Make object.search helper also order by embedded columns |
Description
Agustín Moyano
2020-02-07 22:15:55 UTC
Created attachment 98604 [details] [review] 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 Path doesn't apply: .git/rebase-apply/patch:67: trailing whitespace. warning: 1 line adds whitespace errors. Using index info to reconstruct a base tree... M Koha/REST/Plugin/Query.pm M t/db_dependent/Koha/REST/Plugin/Objects.t .git/rebase-apply/patch:67: trailing whitespace. warning: 1 line applied after fixing whitespace errors. Dependency 24502 was in Failed QA state. Patches now apply. Created attachment 99338 [details] [review] 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> Created attachment 99353 [details] [review] 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> Clear patch and no QA failures. Passing QA Nice work everyone! Pushed to master for 20.05 enhancement not backported to 19.11.x |