DateTime Mapper always defaults to "now" when submission has empty value

Created on 28 August 2025, 24 days ago

Problem/Motivation

When mapping a webform datetime field to a DrupalDateTime field, the mapper treats empty strings as "now".

Proposed resolution

Treat empty values as NULL. I guess the problem is this line here:

https://git.drupalcode.org/project/webform_content_creator/-/blob/4.x/sr...

$datetime = new DrupalDateTime('', 'UTC');

$datetime will be always "now".

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇦🇹Austria daniel.pernold

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

Comments & Activities

Production build 0.71.5 2024