https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44353 Bug ID: 44353 Summary: Acquisition orders API returns 500 when combining active and basket filters Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: nugged@gmail.com Reporter: nugged@gmail.com QA Contact: tomascohen@gmail.com CC: tomascohen@gmail.com Target Milestone: --- Combining only_active=1 with a JSON q filter on basket_id makes GET /api/v1/acquisitions/orders return HTTP 500. The active-order filter joins aqbasket; basket_id maps to unqualified basketno, which then exists in both aqorders and aqbasket. Qualify known root columns with the current resultset alias while parsing JSON q filters. Preserve explicit relationship paths, operators, datetime/boolean conversions and the current active-order predicate. Simple query parameters outside JSON q are unchanged. Before applying the patch: 1. Identify a basket containing an outstanding ordered line. 2. As an authenticated staff API user, request GET /api/v1/acquisitions/orders?only_active=1&q={"basket_id":ID} replacing ID and URL-encoding the JSON query. 3. Observe HTTP 500: the basketno column is ambiguous. Apply the patch. After applying the patch: 1. Repeat the same request. It returns HTTP 200 and only active orders belonging to the selected basket. 2. Repeat with x-koha-embed: basket. The same matching orders and their basket objects are returned. 3. Repeat the active-only and basket-only requests; both still work. Regression coverage includes nested filters, sorting, pagination, standing/ordinary baskets, default/alternate resultset aliases and Action Logs date filters with and without an item embed. Related work: Bug 43344 establishes use of current_source_alias in acquisition-order filtering. Bug 43241 added the nested datetime/boolean conversions in this parser; this fix preserves them. -- You are receiving this mail because: You are watching all bug changes.