verbb / snipcart

A Craft CMS plugin to integrate with Snipcart.
Other
21 stars 9 forks source link

Error “SKU must be unique” on updating entries #12

Closed klick closed 5 years ago

klick commented 5 years ago

Describe the bug

Products can not be saved. Craft throws a “SKU must be unique”-Error on Update entry although the SKU is unique. I am using the Snipcart Product Details field type.

Edit: The error is “Couldn’t publish draft.” with the reason “SKU must be unique” given.

To Reproduce

Steps to reproduce the behavior:

  1. Open existing entry.
  2. Modify any custom field.
  3. Click Update entry
  4. See error.

Expected behavior

Entry is being updated.

Software

Additional context

Probably a Problem with Craft’s new handling of Drafts?

Please don't post full logs here! Send to support@workingconcept.com.

mattstein commented 5 years ago

Thanks for the report, @klick! I'll take a look soon and get this worked out.

mattstein commented 5 years ago

While I've still got some work to do, this branch should fix the validation problem in 3.2.0-RC2: https://github.com/workingconcept/snipcart-craft-plugin/tree/1.1.2

klick commented 5 years ago

Thank you!

I couldn’t install this version but will instead just replace ProductDetails.php for the time being.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package workingconcept/craft-snipcart 1.1.2 exists as workingconcept/craft-snipcart[1.0.0, 1.0.0-beta.1, 1.0.0-beta.10, 1.0.0-beta.11, 1.0.0-beta.12, 1.0.0-beta.13, 1.0.0-beta.14, 1.0.0-beta.15, 1.0.0-beta.16, 1.0.0-beta.17, 1.0.0-beta.18, 1.0.0-beta.2, 1.0.0-beta.20, 1.0.0-beta.21, 1.0.0-beta.22, 1.0.0-beta.23, 1.0.0-beta.24, 1.0.0-beta.25, 1.0.0-beta.26, 1.0.0-beta.27, 1.0.0-beta.3, 1.0.0-beta.4, 1.0.0-beta.5, 1.0.0-beta.6, 1.0.0-beta.7, 1.0.0-beta.8, 1.0.0-beta.9, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.6.1, 1.0.7, 1.0.7.x-dev, 1.1.0, 1.1.1, 1.1.2.x-dev, dev-docs, dev-master] but these are rejected by your constraint.

Edit: That seems to work.

mattstein commented 5 years ago

We're waiting on me to test and release this fix, @klick. I'm looking to have that done by the end of this week!

klick commented 5 years ago

Ok cool. Thanks.

mattstein commented 5 years ago

Finally released in 1.1.2. Sorry for the long wait, @klick!

klick commented 5 years ago

No problem!