Active
Project:
Date
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2023 at 22:36 UTC
Updated:
3 Oct 2024 at 09:26 UTC
Jump to comment: Most recent
With Date 7.x-2.14 doing validations via form_validate_alter, $form_state['values'] (or $node with node_validate_alter) is empty. With earlier versions of Date the form values are passed to the validation so they can be validated. With 2.14 all values are NULL.
Drupal Core: 7.98
Date 7.x-2.14 vs. 7.x-2.13
Add a Date/Time field to a content type.
Do a custom validation and check against the value (i.e. isset($form_state['values']['field_appointment_date']['und'][0]['value'])
Will always fail because all date values are NULL to validation
Try the above with 2.13. Works fine.
Comments
Comment #2
jvogt commentedI couldn't replicate this, but it's possible we're not using the same field type. With the Date module installed, I see three field type options: Date, Date (ISO format), and Date (Unix timestamp). Are you using one of these or do you have a field type called "Date/Time"?
I tested with the Date field type.
PHP: 8.1
Core: 7.98
Date: 7.x-2.14
Field type: Date
Field settings:
---
More settings and values:
---
Widget: Pop-up calendar
---
TEST
Input: 09/13/2023 11:30AM
Code:
Output: "Date value: 2023-09-13 11:30:00"
Comment #3
HallSL commentedI am having this issue on a 2.14 update.
My date type is Date (ISO format).
Comment #4
steinmb commented