Date field validation broken after update to 7.x-2.11

Created on 17 March 2021, over 3 years ago
Updated 23 January 2023, almost 2 years ago

After update to 7.x-2.11, the date field shows a validation error -- a false positive -- and users cannot submit the form. Here is the validation message:

The value input for field Date is invalid:
The value March 24 2021 12:20pm does not match the expected format.

After rolling back to 7.x-2.10, field validation works properly and the form can be submitted.

Besides Date, the other related modules I have enabled are Date API, Date Popup and Date Views.

This is happening with a custom form for submitting a custom entity. The relevant form element looks like this...

$form['time'] = array(
      '#title' => t('Date'),
      '#type' => 'date_popup',
      '#date_format' => 'd M Y - g:i a',
      '#date_timezone' => 'America/New_York',
      '#date_year_range' => '-0:+1',
      '#date_increment' => 15,
      '#required' => TRUE,
      '#description' => t('Note: Do not schedule a session without confirming with your instructor first.'),
      '#default_value' => isset($the_time) ? date('Y-m-d', $the_time) : '',
      '#weight' => -7,
    );

And this is how the field looks in my hook_schema() implementation...

'time' => array(
        'description' => 'The session date/time. Unix timestamp.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => '0',
      ),
πŸ› Bug report
Status

Fixed

Version

2.0

Component

Date Popup

Created by

πŸ‡ΊπŸ‡ΈUnited States arnoldbird

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024