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

Data too long for column 'descriptioinFormat' when saving Order Description Format #989

Closed
nickcobley opened this issue Aug 30, 2019 · 4 comments

Comments

@nickcobley
Copy link

Description

I have a particularly long Order Description Format, that just pushing over the 255 limit for the descriptionFormat column.

If you try and save any Order Description Format that's > 255 characters, it will thow this error:

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'descriptionFormat'

While in my case, ideally, it would take larger than this, the fallback position for me would be that this error is handled gracefully, or it didn't allow you to input more than 255 characters in the first place.

Additional info

  • Craft version: 3.3.0.1
  • Plugins & versions: Commerce 2.1.12.1
@lukeholder
Copy link
Member

lukeholder commented Aug 30, 2019

The next Craft release (3.3.1) will make it possible for you to include a front-end template from the Automatic SKU Format setting (and other settings like it).

So you can change the value to something like:

{% include '_orderDescriptionFormat' %}

And then create a _orderDescriptionFormat.twig file in your templates/ folder, which contains all of that Twig code.

If you want to get that change ahead of time, change your craftcms/cms requirement in composer.json to:

"require": {
"craftcms/cms": "dev-develop#db67c285b2c89d86a0a1bfc68b2cfdd199a54425 as 3.3.0.1",
"...": "..."
}
Then run composer update.

lukeholder added a commit that referenced this issue Aug 30, 2019
@nickcobley
Copy link
Author

Thanks for that. I'll wait for it to come down with the next release, I'm in no particular rush.

I wouldn't say this issue is fixed though. Even with that change unless there are changes to that field in the next release, it's still letting you attempt to insert a string that's always going to fail without any clear feedback to the user?

@lukeholder
Copy link
Member

lukeholder commented Aug 30, 2019

@nickcobley that's what my commit above was for :)

7b404ae#diff-224e3c55be3bac2fe9260bc466cb0592R148

@nickcobley
Copy link
Author

That commit wasn't there when I replied :) Or at least it arrived within 30 seconds of me hitting send or something. Makes sense now :)

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