Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column purchaseTotal cannot be null #673

Closed
RaederDev opened this issue Jan 30, 2019 · 2 comments
Closed

Column purchaseTotal cannot be null #673

RaederDev opened this issue Jan 30, 2019 · 2 comments
Labels

Comments

@RaederDev
Copy link

Description

This error gets thrown in the CMS if the user removes the Purchase total field content.
Is there no validation of field values done in the CMS??

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'purchaseTotal' cannot be null
The SQL being executed was: UPDATE `commerce_discounts` SET `perUserLimit`=1, `perEmailLimit`=1, `totalUseLimit`=0, `purchaseTotal`=NULL, `purchaseQty`=0, `maxPurchaseQty`=0, `baseDiscount`='-16.6667', `perItemDiscount`='-0', `percentDiscount`='-0', `excludeOnSale`=0, `freeShipping`=0, `allGroups`=1, `allPurchasables`=1, `allCategories`=1, `enabled`=1, `stopProcessing`=1, `dateUpdated`='2019-01-30 18:42:00' WHERE `id`=2

Steps to reproduce

  1. Create Discount
  2. Delete Value in Purchase Total Field
  3. Click save

Additional info

  • Craft version: Craft Pro 3.1.6.1
  • PHP version: 7.2.13
  • Database driver & version: MySQL 5.5.5
  • Craft commerce version: 2.0.2
@RaederDev
Copy link
Author

Same also happens with a lot of other fields in the discount section for example but not limited to: maxPurchaseQty, purchaseQty, totalUseLimit, perUserLimit, perEmailLimit

@lukeholder
Copy link
Member

Thanks fixed for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants