Fix unreachable numberrange case in the filter widget - #1534
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change restores numeric-range filter values while preserving existing number-filter behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
renderScopeElementrepeatscase 'number'andcase 'numberrange'inside one switch: once as a pair at the top of the shared min/max/step block, and once each below it. PHP jumps to the first label that matches, so the two lower ones are never entered on their own. Anumberrangescope enters at the top pair, runs the shared block, falls through into thecase 'number'body and breaks there, sominStr,min,maxStrandmaxnever reach the partial and the range inputs render without their values.The
// no breakcomment shows the intent was a fallthrough into a per-type block, which is what a switch cannot do when the label is already above. I turned the two lower cases into a branch on$scope->typeinside the shared block, so the shared parameters still apply to both and each type keeps its own half.numberscopes behave the same before and after: they used to reach that body by fallthrough, now they reach it through theelseif.Summary by CodeRabbit