Inconsistency in sizes

Created on 30 December 2022, over 1 year ago
Updated 1 April 2023, about 1 year ago

Maximums are adjusted according to scheme

Scheme: iframe/src/Plugin/Field/FieldType/IframeItem.php:87

        ...
        'url' => [
          'description' => 'The URL of the iframe.',
          'type' => 'varchar',
          'length' => 2048,
          'not null' => FALSE,
          'sortable' => TRUE,
          'default' => '',
        ],
        'title' => [
          'description' => 'The iframe title text.',
          'type' => 'varchar',
          'length' => 255,
          'not null' => FALSE,
          'sortable' => TRUE,
          'default' => '',
        ],
        ....

and widget base: iframe/src/Plugin/Field/FieldWidget/IframeWidgetBase.php:368

        ...
    $element['title'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Iframe Title'),
      '#placeholder' => '',
      '#default_value' => $settings['title'],
      '#size' => 80,
      '#maxlength' => 1024,
      '#weight' => 2,
      // '#element_validate' => array('text'),
    ] + $required;

    $element['url'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Iframe URL'),
      '#placeholder' => 'https://',
      '#default_value' => $settings['url'] ?? '',
      '#size' => 80,
      '#maxlength' => 1024,
      '#weight' => 1,
      '#element_validate' => [[$this, 'validateUrl']],
    ] + $required;
        ....

this produces the following error
Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡±Chile Aneida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024