Skip to content

Model save erroneously sends unchanged attributes to API #1133

@matthewlein

Description

@matthewlein

Issue summary

There are a number of issues coming from the shopify gem erroneously sending the entire object when saving as outlined here almost 6 months ago: #1037

The gem should only send the changed attributes to the API, but it sends all fields, leading to API errors.

Changing/Saving any part of a Customer created without an email (phone number only) through the checkout will return
{"email_marketing_consent"=>["An email address is required when setting the email marketing consent."]}

Changing/Saving any part of a Customer with a nil email_marketing_consent.opt_in_level will return
{"email_marketing_consent"=>["Opt in level must exist"]}

Changing/Saving any part of an Order (maybe from POS?) without a shipping address will return
{"shipping_address"=>[": Enter a last name."]}

  • shopify_api version: 12.3.0
  • Ruby version: 2.7.2
  • Operating system: All

Expected behavior

The gem should only send the changed attributes on save, as outlined in #1037

Actual behavior

The gem sends all attributes leading to api errors.

Steps to reproduce the problem

see #1037

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions