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.

This updates the product picker for the line_item_option_value form
to not allow selecting multiple products per entry.
@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
Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.87%. Comparing base (5c415e7) to head (86bdfdb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6233   +/-   ##
=======================================
  Coverage   88.87%   88.87%           
=======================================
  Files         842      842           
  Lines       18231    18231           
=======================================
  Hits        16202    16202           
  Misses       2029     2029           

☔ 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.

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.
@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
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