nhovratov / content-blocks

TYPO3 CMS Content Blocks - Content Types API

Home Page:https://docs.typo3.org/p/contentblocks/content-blocks/main/en-us/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL type "varchar" for fieldtype "Select" could be too short for storing data

PKuhlmay opened this issue · comments

Hi I have a fieldtype select, where I can select pages.

  - identifier: references
    type: Select
    renderType: selectTree
    size: 20
    foreign_table: 'pages'
    foreign_table_where: 'ORDER BY pages.uid'
    treeConfig:
      parentField: pid
      appearance:
        expandAll: true
        showHeader: true

In the database this field is created with a varchar:

return "`$column` VARCHAR(255) DEFAULT '' NOT NULL";

In some cases this could lead into an error like this:
Bildschirmfoto 2024-04-30 um 09 45 14

I checked a lot of pages inside the selectTree, untill it came to this error. There might be very few cases where it could come to this error but it could happen.

The field "pages" is stored with type "text" inside the database, maybe this could be the solution for type "Select" of CB.

This will be solved automatically with v13 as SQL columns will be generated based on TCA and the best fitting type will be chosen. For now, one must override the SQL in ext_tables.sql if varchar is not enough.

Okay I close this for now.