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

Shipping Methods Error - Integrity constraint violation #500

Closed
davist11 opened this issue Sep 20, 2018 · 1 comment
Closed

Shipping Methods Error - Integrity constraint violation #500

davist11 opened this issue Sep 20, 2018 · 1 comment

Comments

@davist11
Copy link
Contributor

Description

When editing a Shipping Method, and toggling the "Enable this shipping method on the front end" lightswitch off, an Integrity constraint violation error is thrown

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'enabled' cannot be null in /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/Command.php:1258
Stack trace:
#0 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/Command.php(1258): PDOStatement->execute()
#1 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/Command.php(1075): yii\db\Command->internalExecute('UPDATE `craft_c...')
#2 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/ActiveRecord.php(281): yii\db\Command->execute()
#3 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/BaseActiveRecord.php(802): yii\db\ActiveRecord::updateAll(Array, Array)
#4 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/ActiveRecord.php(625): yii\db\BaseActiveRecord->updateInternal(NULL)
#5 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/BaseActiveRecord.php(673): yii\db\ActiveRecord->update(false, NULL)
#6 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/commerce/src/services/ShippingMethods.php(271): yii\db\BaseActiveRecord->save(false)
#7 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/commerce/src/controllers/ShippingMethodsController.php(91): craft\commerce\services\ShippingMethods->saveShippingMethod(Object(craft\commerce\models\ShippingMethod))
#8 [internal function]: craft\commerce\controllers\ShippingMethodsController->actionSave()
#9 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Controller.php(103): yii\base\Controller->runAction('save', Array)
#12 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save', Array)
#13 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Application.php(282): yii\base\Module->runAction('commerce/shippi...', Array)
#14 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Application.php(541): craft\web\Application->runAction('commerce/shippi...', Array)
#15 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#16 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /storage/av05091/www/public_html/releases/20180920091802/public/index.php(46): yii\base\Application->run()
#18 {main}

Next yii\db\IntegrityException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'enabled' cannot be null
The SQL being executed was: UPDATE `craft_commerce_shippingmethods` SET `enabled`=NULL, `dateUpdated`='2018-09-20 17:50:42' WHERE `id`=19 in /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/Schema.php:664
Stack trace:
#0 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/Command.php(1263): yii\db\Schema->convertException(Object(PDOException), 'UPDATE `craft_c...')
#1 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/Command.php(1075): yii\db\Command->internalExecute('UPDATE `craft_c...')
#2 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/ActiveRecord.php(281): yii\db\Command->execute()
#3 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/BaseActiveRecord.php(802): yii\db\ActiveRecord::updateAll(Array, Array)
#4 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/ActiveRecord.php(625): yii\db\BaseActiveRecord->updateInternal(NULL)
#5 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/db/BaseActiveRecord.php(673): yii\db\ActiveRecord->update(false, NULL)
#6 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/commerce/src/services/ShippingMethods.php(271): yii\db\BaseActiveRecord->save(false)
#7 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/commerce/src/controllers/ShippingMethodsController.php(91): craft\commerce\services\ShippingMethods->saveShippingMethod(Object(craft\commerce\models\ShippingMethod))
#8 [internal function]: craft\commerce\controllers\ShippingMethodsController->actionSave()
#9 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Controller.php(103): yii\base\Controller->runAction('save', Array)
#12 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save', Array)
#13 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Application.php(282): yii\base\Module->runAction('commerce/shippi...', Array)
#14 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Application.php(541): craft\web\Application->runAction('commerce/shippi...', Array)
#15 /storage/av05091/www/public_html/releases/20180920091802/vendor/craftcms/cms/src/web/Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#16 /storage/av05091/www/public_html/releases/20180920091802/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /storage/av05091/www/public_html/releases/20180920091802/public/index.php(46): yii\base\Application->run()
#18 {main}
Additional Information:
Array
(
    [0] => 23000
    [1] => 1048
    [2] => Column 'enabled' cannot be null
)

Steps to reproduce

  1. Create a shipping method
  2. Toggle the Enable this shipping method on the front end" lightswitch off
  3. Save

Additional info

  • Craft version: Craft Pro 3.0.24
  • PHP version: 7.0.32
  • Database driver & version: MySQL 5.7.23
  • Commerce version: dev-devlop, commit 2cb5ee5
@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants