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

Created on 28 July 2024, 4 months ago
Updated 29 August 2024, 3 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

  • Issue created by @nikit
  • 🇮🇳India prashant.c Dharamshala

    @nikit

    Thanks for raising this. We will replicate this.
    Any patches are welcome.

  • 🇮🇳India prashant.c Dharamshala
  • 🇮🇳India prashant.c Dharamshala

    @nikit

    I tried to replicate this on Drupal 10.3.1 but could not.

    1. Did you download the libraries to your Drupal root folder -> libraries -> tempus-dominus?
    2. Did you try enabling the "Use CDN for Tempus dominas" on the module's settings page admin/config/content/bootstrap_datetime_picker

    Thanks

Production build 0.71.5 2024