Error on setting scheduled opening or closing date

Created on 30 June 2023, over 1 year ago
Updated 9 October 2023, about 1 year ago

Problem/Motivation

When setting a date and time to open or close a Webform in the form settings > form under form status, it is not possible to save the settings and an error occurs: "The website encountered an unexpected error. Please try again later."


The log shows the following error:

Error: Class 'Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface' not found in Drupal\webform\Utility\WebformDateHelper::formatStorage() (line 70 of /var/www/.../drupal/web/modules/contrib/webform/src/Utility/WebformDateHelper.php)
The error appears also with 6.1.x versions of Webform.

Steps to reproduce

Choose any Webform go to "Settings" > "Form" (admin/structure/webform/manage/my_form/settings/form).

Set the "Form status" to "scheduled" and set a date and time for either "Open" or "Close" or both and then try to save the settings by scrolling to the bottom of the page and pressing "Save".

The the page should turn white with the mentioned error message and in the log is a php error noted.

Proposed resolution

Check why class isn't loaded.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

6.1

Component

Code

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

Comments & Activities

Production build 0.71.5 2024