Skip to content

Conversation

@manleyac
Copy link

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:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@manleyac manleyac requested a review from a team as a code owner May 12, 2025 19:00
@github-actions github-actions bot added the changelog:solidus_promotions Changes to the solidus_promotions gem label May 12, 2025
@codecov
Copy link

codecov bot commented May 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.75%. Comparing base (06ebabf) to head (25285b3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6233      +/-   ##
==========================================
- Coverage   89.34%   88.75%   -0.60%     
==========================================
  Files         961      851     -110     
  Lines       20173    18214    -1959     
==========================================
- Hits        18024    16166    -1858     
+ Misses       2149     2048     -101     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@tvdeyen tvdeyen left a 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.

@manleyac manleyac marked this pull request as draft May 14, 2025 15:54
@manleyac manleyac force-pushed the fix-line-item-option-condition-params branch from 86bdfdb to 674cbcc Compare May 14, 2025 15:54
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.
@mamhoff mamhoff force-pushed the fix-line-item-option-condition-params branch from 674cbcc to 25285b3 Compare November 3, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_promotions Changes to the solidus_promotions gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants