https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43344 Bug ID: 43344 Summary: OPAC does not show the On order item status when acquisition details are enabled Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: nugged@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 36018 Target Milestone: --- When OPACAcquisitionDetails is enabled, the OPAC checks active acquisition orders for each item. For an item linked to an outstanding order, this check logs the following SQL error: Unknown column 'me.quantity' in 'WHERE' The order count returns no value, so the item is not displayed with the On order status. Steps to reproduce: 1. Set OPACAcquisitionDetails to Show. 2. Set AcqCreateItem to create an item when placing an order. 3. Create a basket and add an order for a bibliographic record, including an item. 4. Close the basket so the order is active and outstanding. 5. Open the bibliographic record in the OPAC. Expected result: The item is displayed with the On order status and no SQL error is logged. Actual result: The On order status is not displayed and the SQL error is logged. Technical note: item-status.inc calls item.orders.filter_by_active.count. item->orders is a many-to-many DBIx::Class resultset whose current source alias is ordernumber. filter_by_active hard-codes me.quantity, so the generated SQL refers to an alias that is not present in this query. This was introduced by the Bug 36018 follow-up that qualified quantity to avoid ambiguity in REST API joins. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36018 [Bug 36018] Improve consistency in Acquisition/Order(s) regarding active/current orders -- You are receiving this mail because: You are watching all bug changes.