Unable to add more than 128 characters worth of dates

Created on 29 January 2025, 3 months ago

Problem/Motivation

I am unable to add more than 10 dates on a single multiple_dates field. When trying to add more than this, I get the error Availability cannot be longer than 128 characters but is currently 130 characters long..

Each date takes up 12 characters if we include the comma and space: 2025-01-29,

For some reason, the field can only hold 128 characters. This, despite the text field size being set to big.

Steps to reproduce

  • Create a multiple_dates field on a content type.
  • Field settings: Limited, 1
  • Start creating a piece of content with that field.
  • Select more than 10 dates.
  • Press 'Save'.
  • Error appears.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇨🇦Canada trevorkjorlien

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

Comments & Activities

  • Issue created by @trevorkjorlien
  • 🇩🇪Germany vasquezponte

    I'm using this hook in my module:

    /**
     * Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
     */
    function MYMODULE_field_widget_single_element_multiple_dates_default_widget_form_alter(array &$element, FormStateInterface $form_state, array $context) {
      $element['multiple_dates']['#maxlength'] = 255;
    }
    
    
Production build 0.71.5 2024