Closed splendidrob closed 1 year ago
Hi @splendidrob I was able to recreate the overflow issue and I have reported it to Craft CMS
I was unable to recreate the SQL error, is there any chance that you can send me a screenshot to support@enupal.com to see how long if the plan name?
Hi @andrelopez I too have run into this issue today doing similar. After selecting a subscription plan (for the subscription type "Customer chooses plan" subscription plan matrix block) to an existing payments form and then attempting to save.
Stack trace is:
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_subscriptionPlan_selectPlan_zqxhuwdb' at row 1 in /var/www/html/build/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /var/www/html/build/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /var/www/html/build/vendor/yiisoft/yii2/db/Command.php(1102): yii\db\Command->internalExecute('UPDATE `matrixc...')
#2 /var/www/html/build/vendor/craftcms/cms/src/helpers/Db.php(1086): yii\db\Command->execute()
#3 /var/www/html/build/vendor/craftcms/cms/src/services/Content.php(158): craft\helpers\Db::update('{{%matrixconten...', Array, Array, Array, true, Object(craft\db\Connection))
#4 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(3373): craft\services\Content->saveContent(Object(craft\elements\MatrixBlock))
#5 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(1098): craft\services\Elements->_saveElementInternal(Object(craft\elements\MatrixBlock), false, false, true, Array, false, false)
#6 /var/www/html/build/vendor/craftcms/cms/src/services/Matrix.php(719): craft\services\Elements->saveElement(Object(craft\elements\MatrixBlock), false)
#7 /var/www/html/build/vendor/craftcms/cms/src/fields/Matrix.php(1101): craft\services\Matrix->saveField(Object(craft\fields\Matrix), Object(enupal\stripe\elements\PaymentForm))
#8 /var/www/html/build/vendor/craftcms/cms/src/base/Element.php(5175): craft\fields\Matrix->afterElementPropagate(Object(enupal\stripe\elements\PaymentForm), false)
#9 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(3424): craft\base\Element->afterPropagate(false)
#10 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(1098): craft\services\Elements->_saveElementInternal(Object(enupal\stripe\elements\PaymentForm), true, false, true, Array, false, false)
#11 /var/www/html/build/vendor/enupal/stripe/src/services/PaymentForms.php(164): craft\services\Elements->saveElement(Object(enupal\stripe\elements\PaymentForm))
#12 /var/www/html/build/vendor/enupal/stripe/src/controllers/PaymentFormsController.php(58): enupal\stripe\services\PaymentForms->savePaymentForm(Object(enupal\stripe\elements\PaymentForm))
#13 [internal function]: enupal\stripe\controllers\PaymentFormsController->actionSaveForm()
#14 /var/www/html/build/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#15 /var/www/html/build/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#16 /var/www/html/build/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save-form', Array)
#17 /var/www/html/build/vendor/craftcms/cms/src/web/Application.php(304): yii\base\Module->runAction('enupal-stripe/p...', Array)
#18 /var/www/html/build/vendor/craftcms/cms/src/web/Application.php(607): craft\web\Application->runAction('enupal-stripe/p...', Array)
#19 /var/www/html/build/vendor/craftcms/cms/src/web/Application.php(283): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#20 /var/www/html/build/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#21 /var/www/html/build/public/index.php(12): yii\base\Application->run()
#22 {main}
Next yii\db\Exception: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_subscriptionPlan_selectPlan_zqxhuwdb' at row 1
The SQL being executed was: UPDATE `matrixcontent_enupalmultipleplans` SET `elementId`=24756, `siteId`=1, `field_subscriptionPlan_selectPlan_zqxhuwdb`='price_1NIa4YBZ4NJfXTm9l7JkErAt', `field_subscriptionPlan_customLabel_pgdqjqum`='Monthly', `field_subscriptionPlan_setupFee_fofqtjzy`=NULL, `field_subscriptionPlan_default_rblwlxaj`=0, `dateUpdated`='2023-10-27 15:44:37' WHERE `id`=2 in /var/www/html/build/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /var/www/html/build/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException(Object(PDOException), 'UPDATE `matrixc...')
#1 /var/www/html/build/vendor/yiisoft/yii2/db/Command.php(1102): yii\db\Command->internalExecute('UPDATE `matrixc...')
#2 /var/www/html/build/vendor/craftcms/cms/src/helpers/Db.php(1086): yii\db\Command->execute()
#3 /var/www/html/build/vendor/craftcms/cms/src/services/Content.php(158): craft\helpers\Db::update('{{%matrixconten...', Array, Array, Array, true, Object(craft\db\Connection))
#4 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(3373): craft\services\Content->saveContent(Object(craft\elements\MatrixBlock))
#5 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(1098): craft\services\Elements->_saveElementInternal(Object(craft\elements\MatrixBlock), false, false, true, Array, false, false)
#6 /var/www/html/build/vendor/craftcms/cms/src/services/Matrix.php(719): craft\services\Elements->saveElement(Object(craft\elements\MatrixBlock), false)
#7 /var/www/html/build/vendor/craftcms/cms/src/fields/Matrix.php(1101): craft\services\Matrix->saveField(Object(craft\fields\Matrix), Object(enupal\stripe\elements\PaymentForm))
#8 /var/www/html/build/vendor/craftcms/cms/src/base/Element.php(5175): craft\fields\Matrix->afterElementPropagate(Object(enupal\stripe\elements\PaymentForm), false)
#9 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(3424): craft\base\Element->afterPropagate(false)
#10 /var/www/html/build/vendor/craftcms/cms/src/services/Elements.php(1098): craft\services\Elements->_saveElementInternal(Object(enupal\stripe\elements\PaymentForm), true, false, true, Array, false, false)
#11 /var/www/html/build/vendor/enupal/stripe/src/services/PaymentForms.php(164): craft\services\Elements->saveElement(Object(enupal\stripe\elements\PaymentForm))
#12 /var/www/html/build/vendor/enupal/stripe/src/controllers/PaymentFormsController.php(58): enupal\stripe\services\PaymentForms->savePaymentForm(Object(enupal\stripe\elements\PaymentForm))
#13 [internal function]: enupal\stripe\controllers\PaymentFormsController->actionSaveForm()
#14 /var/www/html/build/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#15 /var/www/html/build/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#16 /var/www/html/build/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save-form', Array)
#17 /var/www/html/build/vendor/craftcms/cms/src/web/Application.php(304): yii\base\Module->runAction('enupal-stripe/p...', Array)
#18 /var/www/html/build/vendor/craftcms/cms/src/web/Application.php(607): craft\web\Application->runAction('enupal-stripe/p...', Array)
#19 /var/www/html/build/vendor/craftcms/cms/src/web/Application.php(283): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#20 /var/www/html/build/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#21 /var/www/html/build/public/index.php(12): yii\base\Application->run()
#22 {main}
Additional Information:
Array
(
[0] => 22001
[1] => 1406
[2] => Data too long for column 'field_subscriptionPlan_selectPlan_zqxhuwdb' at row 1
)
Craft version: Craft Pro 4.5.6.1 PHP version: 8.1 Database driver & version: mariadb 10.4 Plugin version: 5.4.0 Is [SCA] and Stripe Checkout enabled?: yes
Just checking in if any new guidance on this? Doesn't seem to currently be possible to use this for subscriptions?
I am on it
@splendidrob could you please let me know your Stripe API version? on your Stripe Dashboard click on Developers
API version
[2023-10-16] Default Latest [2022-11-15] [2020-08-27]
Thanks the issue is related to a new setting introduced on Craft 4.5 13025
I am working on a solution now
We just released Stripe Payments v5.5.0 with a fix to this issue. Thanks for reporting and let us know if that works on your end
Awesome! Thats fixed...many thanks for sorting!
Description
Testing a subscription plan - added the first one to the payment form in the matrix for multiple plans, errors with the following:
Caused by: PDOException SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_subscriptionPlan_selectPlan_wegrnswj' at row 1
This is a subscription price added to a product within stripe. The title seems to be pulling in the price id also and flows out of the dropdown box...
Craft version: Craft Pro 4.5.5 PHP version: 8.2.0 Database driver & version: MySQL 5.7.39 Plugin version: 5.4.0 Is [SCA] and Stripe Checkout enabled?: yes