Repository navigation
Return early from sortAndFilterCart() when no items are printable - #4713
objecttothis merged 4 commits into
Conversation
…pensourcepos#4685) Co-authored-by: Rayan Abdul Cader <[email protected]>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesEmpty cart handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The completion flows use the renamed method, and an empty printable cart returns safely before sorting. No actionable merge risk is evident. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change affects an unusual invoice-printing case after a sale is saved. No new access path or change to the saved sale is apparent, but the exact invoice display and prior failure behavior have not been verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Out of Scope Changes checkExplanation The PR also renames the public method from
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #4685
When a cart has lines but none are printable, filtering leaves an empty result and the sorting branches can call
array_multisort()on keys that were never set.sortAndFilterCart()now returns the empty filtered cart immediately after filtering, before any sorting happens.As requested in objecttothis’s review, the helper and its
$filteredCartlocal use camelCase naming, and all four internal call sites in the Sales controller are updated. A repository-wide search found no route, AJAX, or frontend references to the helper name. Filtering and sorting behavior is preserved.Summary by CodeRabbit