-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix line item option condition params #6233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix line item option condition params #6233
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6233 +/- ##
=======================================
Coverage 89.44% 89.44%
=======================================
Files 973 973
Lines 20298 20298
=======================================
Hits 18156 18156
Misses 2142 2142 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tvdeyen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Would you mind to add some specs? This should have been caught by specs in the first place.
86bdfdb to
674cbcc
Compare
674cbcc to
25285b3
Compare
86edf8a to
9bb6e94
Compare
This updates the product picker for the line_item_option_value form to not allow selecting multiple products per entry.
This fixes an issue where the option-value-picker was not receiving the id for the selected product. Therefore the correct option values where not available and the params where malformed.
When creating an option value condition, we only want to have option values that fit the product in question. This commit makes it such that the option value picker re-initializes when the selected product changes.
9bb6e94 to
b0eda8b
Compare
tvdeyen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Tested manually. Worth a back port, since this is an actual bug in a released version
promotions/spec/system/solidus_promotions/backend/promotions_spec.rb
Outdated
Show resolved
Hide resolved
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Summary
This fixes a bug being unable to create a line_item_option_value condition. Adding a line_item_option_value as a condition to a benefit will raise a TypeError due to the form submitting an array when a hash is expected.
Currently, the product-picker allows for selecting multiple products when only one product should be selected per entry. The selected product id is not passed to the option-value-picker resulting in the params being malformed and the conditions_controller raising a 500 on create.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: