[Bug 42588] New: biblio.uncancelled_orders+count is not sortable on the API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42588 Bug ID: 42588 Summary: biblio.uncancelled_orders+count is not sortable on the API Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com Depends on: 41950 The biblio.uncancelled_orders+count embed on the acquisitions orders endpoint cannot be sorted because the uncancelled_orders DBIC relationship does not exist on the Biblio result class. The Koha::Biblio->uncancelled_orders method currently calls self->orders->filter_out_cancelled which filters on datecancellationprinted => undef in Perl. To make it sortable, we need: 1. A DBIC coderef relationship on Biblio that filters aqorders.datecancellationprinted IS NULL 2. Support for undef values (IS NULL) in _build_count_subquery 3. Update Koha::Biblio->uncancelled_orders to delegate to the DBIC relationship 4. Unit tests proving the sort works The generated subquery would be: (SELECT COUNT(*) FROM aqorders WHERE aqorders.biblionumber = me.biblionumber AND aqorders.datecancellationprinted IS NULL) Test plan: prove t/Koha/REST/Plugin/Query.t t/db_dependent/api/v1/acquisitions_orders.t t/db_dependent/Koha/Biblio.t Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41950 [Bug 41950] Make +count embeds sortable by using SQL-level COUNT subqueries -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42588 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42587 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42587 [Bug 42587] overdues+count is not sortable on the API -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42588 Bug 42588 depends on bug 41950, which changed state. Bug 41950 Summary: Make +count embeds sortable by using SQL-level COUNT subqueries https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41950 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org