v2.13.1: Fixes regression with totals on order listing
Fixes
- Order listing totals regression: Fixed bug in v2.13.0 where
select-instrategy for paginated order queries dropped criticalitems.*fields (likequantity), causing order total calculations to fail onGET /admin/ordersandGET /admin/draft-orders - Draft order adjustments now recomputed after changes are applied
- Batch translation settings request now uses correct HTTP type
Highlights
Fixes regression with totals on order listing
This release fixes a bug introduced in v2.13.0 around total fields selection when listing orders. The bug occurs when loading order items with their relations using the select-in strategy:
- The code maps field selections from
items.*toitems.item.*to load OrderLineItem data - However, critical OrderItem fields like
quantitylive on items.detail, not on items.item - These fields were being dropped during the mapping process
- Without quantity data, the order totals couldn't be calculated correctly
The select-in strategy is used when listing orders with pagination options, which is for example used in the GET /admin/orders and GET /admin/draft-orders endpoints.
This fix adds compensatory logic that ensures when items.item.* fields are selected, the corresponding items.* fields are also selected or preserved. This prevents the data required for order calculations from being removed.
Bugs
- fix(medusa): use http type for batch translation settings request by @shahednasser in https://github.com/medusajs/medusa/pull/14612
- fix(core-flows): recompute adjustments for draft orders after changes are added by @fPolic in https://github.com/medusajs/medusa/pull/14511
- fix(order): item relation loading in select-in path by @fPolic in https://github.com/medusajs/medusa/pull/14629
Documentation
- docs: changes for v2.13.0 by @shahednasser in https://github.com/medusajs/medusa/pull/14524
- chore(docs): Updated API Reference (automated) by @github-actions[bot] in https://github.com/medusajs/medusa/pull/14609
- docs: fix references pipeline + generate references for v2.13.0 by @shahednasser in https://github.com/medusajs/medusa/pull/14623
Chores
- chore(docs): Updated UI Reference (automated) by @github-actions[bot] in https://github.com/medusajs/medusa/pull/14608
- chore(docs): Generated DML JSON files (automated) by @github-actions[bot] in https://github.com/medusajs/medusa/pull/14607
- chore(docs): Update version in documentation (automated) by @github-actions[bot] in https://github.com/medusajs/medusa/pull/14611
- chore(medusa): default medusa policies by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/14542
Full Changelog: https://github.com/medusajs/medusa/compare/v2.13.0...v2.13.1