Skip to content
New issue

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

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

Already on GitHub? # to your account

[5.x]: "Data too long for column ‘sku’ at row" when switching revisions #3727

Closed
gopeter opened this issue Oct 16, 2024 · 3 comments
Closed

Comments

@gopeter
Copy link

gopeter commented Oct 16, 2024

What happened?

Description

I wanted to roll back to an older revision of a product, but suddenly all variants were removed. A look at the logs revealed the reason:

caught exception ‘yii\db\Exception’ with message ’SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘sku’ at row 1
The SQL being executed was: UPDATE commerce_purchasables SET sku=‘__temp_cpdwvjihrjmpahvaqhwhhbbiffopyqdlljsj-__temp_oweumktnbvwppomffaukwnqnuwcextywsshx-__temp_ljqqafnpzbnqknjymlmirpbucfxitrwzhnwe-__temp_ygrszrxrooylsbqdwdhygsjoeqlcfpowveom-__temp_pygflgannthbmegmnladmxvavkyqgqjnmnpj-__temp_ahxizahtwavkunnbvdlfutihqgktsckpgchi-myvariant-150’, dateUpdated=‘2024-10-16 08:16:39’ WHERE id=194914' in

Steps to reproduce

  1. Create a product with some variants (we have 6 variants)
  2. Save multiple edits
  3. Open an old revision
  4. Variants field is empty, even if that revision had variants originally

Expected behavior

That it opens a revision with the variants that were saved for that revision

Actual behavior

It opens the revision, but without any variants

Craft CMS version

Craft Pro 5.4.8

Craft Commerce version

5.1.3

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

Copy link

linear bot commented Oct 16, 2024

@lukeholder lukeholder self-assigned this Oct 17, 2024
@lukeholder
Copy link
Member

@gopeter we have a fix forthcoming for this, will update you soon!

@lukeholder
Copy link
Member

This should be fixed as of Craft Commerce 5.2.2.

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants