Skip to content

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

Closed
@sumihiro

Description

@sumihiro

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions