Legacy backend variant creation errors when master has no price
Open
Nobody has claimed this yet.
changelog:solidus_backend
- Dominant language
- Ruby
- Stars
- 5.3k
- Forks
- 1.4k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 62
Description
Solidus Version: 3.2.5
To Reproduce
- create a product
- delete the master price in the default currency (config.currency)
- attempt creating a new variant
- see the exception:
undefined method 'attributes' for nil:NilClasspointing to https://github.com/solidusio/solidus/blob/739b2a63cc3079b8256f8b85816a5a3d81689b76/backend/app/controllers/spree/admin/variants_controller.rb#L19
Current behavior
There's an exception.
Expected behavior
A more friendly behavior is expected.
Screenshots
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in backend/app/controllers/spree/admin/variants_controller.rb at the reported line, then reproduce the steps with the master price removed in the default currency. Confirm the nil case and define completion as replacing the exception with the friendly behavior described by the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100