cancel
Showing results for 
Search instead for 
Did you mean: 

Default Store View value of Text Swatch attribute is too short.

0 Kudos

Default Store View value of Text Swatch attribute is too short.

Feature request from sumihiro, posted on GitHub Aug 22, 2016

I want to use Text Swatch Attribute with long text. But Default Store View value cannot be saved correctly. It will be shrink.

Preconditions

I'm using Magento2.1.0, and MySQL 5.6.30.

Steps to reproduce

  1. Create new Attribute, and select Text Swatch.
  2. Set long text to Default Store View in Manage Swatch. Like: "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "
  3. Save Attribute.

Expected result

  1. Default Store View value is saved full length.

Actual result

  1. Value is shrink. Like: "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234"

May be, it is caused by limitation of max varchar length (255) of MySQL.

mysql> desc eav_attribute_option_value;
+-----------+----------------------+------+-----+---------+----------------+
| Field     | Type                 | Null | Key | Default | Extra          |
+-----------+----------------------+------+-----+---------+----------------+
| value_id  | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| option_id | int(10) unsigned     | NO   | MUL | 0       |                |
| store_id  | smallint(5) unsigned | NO   | MUL | 0       |                |
| value     | varchar(255)         | YES  |     | NULL    |                |
+-----------+----------------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

How to save value correctly?

2 Comments
New Member

Comment from sumihiro, posted on GitHub Aug 22, 2016

Also, I want to use Default Store View as Text Area not Text Field.

New Member

Comment from sumihiro, posted on GitHub Aug 22, 2016

To work around, I changed table scheme:

mysql> alter table eav_attribute_option_value change value value text;

It seems working good, but I don't know what happen when Magento is updated.