Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30571

Legacy storage column size for default TextField value is too short

    Details

      Description

      When I create a new TextField and I want to configure a default value which is longer than 50 characters, a database error is thrown.
      After debugging we noticed, that the default value is saved in ezcontentclass_attribute.data_text1, which has a max_size of 50 chars.
      Since an TextField is capable of 255 chars, it would be lovely to have the default the same size.

      Database error

      An exception occurred while executing 'UPDATE `ezcontentclass_attribute` SET `serialized_name_list` = :placeholder4, `serialized_description_list` = :placeholder5, `identifier` = :placeholder6, `category` = :placeholder7, `placement` = :placeholder8, `data_type_string` = :placeholder9, `can_translate` = :placeholder10, `is_required` = :placeholder11, `is_information_collector` = :placeholder12, `data_float1` = :placeholder13, `data_float2` = :placeholder14, `data_float3` = :placeholder15, `data_float4` = :placeholder16, `data_int1` = :placeholder17, `data_int2` = :placeholder18, `data_int3` = :placeholder19, `data_int4` = :placeholder20, `data_text1` = :placeholder21, `data_text2` = :placeholder22, `data_text3` = :placeholder23, `data_text4` = :placeholder24, `data_text5` = :placeholder25, `serialized_data_text` = :placeholder26, `is_searchable` = :placeholder27 WHERE `id` = :placeholder1 AND `version` = :placeholder2 AND `contentclass_id` = :placeholder3' with params [260, 1, 44, "a:1:{s:6:\"ger-DE\";s:7:\"Youtube\";}", "a:0:{}", "youtube", "content", 12, "ezstring", 0, 0, 0, null, null, null, null, 0, 0, null, null, "https:\/\/youtube.com\/channel\/herecomesalongerstringthan50charssowegetandatabaseerrorbecausethestringistolong", null, null, null, null, "N;", 0]:
       
      SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'data_text1' at row 1
      SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'data_text1' at row 1
      SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'data_text1' at row 1 in file /var/www/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php line 328
      

        Issue Links

          Activity

          Hide
          Michał Szołtysek added a comment -

          QA Approved on v2.5.2 with diff on mysql and psql.

          Show
          Michał Szołtysek added a comment - QA Approved on v2.5.2 with diff on mysql and psql.
          Show
          Michał Szołtysek added a comment - Merged to 7.5: https://github.com/ezsystems/ezpublish-kernel/commit/89c1c887fd7b7f11563de8f34abd981c023a089f

            People

            • Assignee:
              Unassigned
              Reporter:
              Anna Lena
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: