Cannot access offset of type string on string validateStartEnd in DateRangeWidgetBase.php

Created on 28 July 2024, 11 months ago
Updated 29 August 2024, 10 months ago

Problem/Motivation

Date range field isn't working with the widget.

Steps to reproduce

Drupal 10.3.1.
1. Create Date range field in any content type.
2. Set form display field widget to "Bootstrap DateTime Picker".
3. Add content and fill dates and times in field.
4. Save it - you will get error:
TypeError: Cannot access offset of type string on string in Drupal\datetime_range\Plugin\Field\FieldWidget\DateRangeWidgetBase->validateStartEnd() (line 117 of core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeWidgetBase.php).

API changes

Too much the same code in Element/BootstrapDateTime.php as in Element/Datetime.php, what about inheritance?

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇷🇺Russia nikit

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

Comments & Activities

Production build 0.71.5 2024