craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

Forgetting required fields on product creation puts the product in permanent Pending status #774

Closed echantigny closed 5 years ago

echantigny commented 5 years ago

Description

Tried this multiple times to make sure I'm not doing anything weird and I get consitent results with these steps:

Steps to reproduce

  1. Create a product (my product type doesn't have variants), but forget 1 or many of the required fields (sku, price, qty)
  2. Save it
  3. Gives you an error, so fill the missing fields and save
  4. The product is now in Pending status. You can disable it, but it's never possible to fully enable it because it always comes back in pending status.

Additional info

lukeholder commented 5 years ago

Are you getting this on the latest dev-develop? I can't reproduce this issue.

echantigny commented 5 years ago

@lukeholder I've been able to replicate this both in the v2.1.0.2 and the dev-develop branch, without a failed attempt. That being said, I figured out that the issue is a Post Date issue. This does not happen on Normal content entries if I ommit required fields. The correct date-time is set no matter what.

My timezone is set properly: 2019-03-07 09_17_42-general settings - great boardgames

This is my computer's actual time (craft is installed locally): 2019-03-07 09_17_45-

This is the time that is set on the post when I save a new product with missing fields (displayed without the timezone modificator). Because it's in the future for me, the product becomes Pending when I save: 2019-03-07 09_18_08-create a new product - great boardgames

This is the time that is getting set when I save a new product with all the required data (a few minutes after the initial clock capture, so this is accurate): 2019-03-07 09_20_18-bretgdrg - great boardgames

echantigny commented 5 years ago

@lukeholder Please have a look at the entire github issue, I've made significant edits to the content of my post above.

Sorry if you always do, just wanted to make sure you see the edits.

lukeholder commented 5 years ago

I can see the issue and will make a fix.

ccchapman commented 5 years ago

This issue is present for me, but not for the SKU field as the original issue mentions. I think having an automatic SKU format may mask the issue.

lukeholder commented 5 years ago

@echantigny Can you confirm having the same issue with entries? I mean, if you save an entry with a missing title causing a validation error, does the entry's post date get populated any differently than products?

echantigny commented 5 years ago

@lukeholder No, this did not happen in normal content entries, just products.

lukeholder commented 5 years ago

@echantigny Should be fixed on dev-develop, will be in the next release.