Skip to content

Handle missing master price when adding a variant#6506

Open
minhluuquang wants to merge 1 commit into
solidusio:mainfrom
minhluuquang:fix-4831-variant-without-master-price
Open

Handle missing master price when adding a variant#6506
minhluuquang wants to merge 1 commit into
solidusio:mainfrom
minhluuquang:fix-4831-variant-without-master-price

Conversation

@minhluuquang

Copy link
Copy Markdown

Summary

Fixes #4831.

This prevents the admin variant form from raising when a product's master variant has no default price. The new variant action still copies the master default price when it exists, but skips that clone when it is missing so the rendered form can build a blank default-currency price field.

Testing

  • bundle exec rspec spec/controllers/spree/admin/variants_controller_spec.rb
  • bundle exec standardrb backend/app/controllers/spree/admin/variants_controller.rb backend/spec/controllers/spree/admin/variants_controller_spec.rb

I ran these in the backend gem context with Ruby 4.0.1 via mise. Full bin/build was not run locally.

@minhluuquang minhluuquang requested a review from a team as a code owner June 29, 2026 08:59
@github-actions github-actions Bot added the changelog:solidus_backend Changes to the solidus_backend gem label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_backend Changes to the solidus_backend gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception when adding a variant for a product with no master price

1 participant