solidusio / solidusio/solidus

Legacy backend variant creation errors when master has no price

Open
#4,831 0 comments 0 reactions 0 assignees View on GitHub

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

  1. create a product
  2. delete the master price in the default currency (config.currency)
  3. attempt creating a new variant
  4. see the exception: undefined method 'attributes' for nil:NilClass pointing 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

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.