Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If no default value is given for the date field, it is supposed to default to today's date. However, expand_date() uses !isset() to determine whether a value has been given. Since the value is an empty string when not specified, this means the date field defaults to 1 January 1900. The attached patch fixes this by replacing !isset() with empty().
Comment | File | Size | Author |
---|---|---|---|
form.inc-date.patch | 735 bytes | Darren Oh | |
Comments
Comment #1
Darren OhIf anyone would like to test this, I suggest trying the following code with and without the patch:
Comment #2
chx CreditAttribution: chx commentedYup.
Comment #3
drummCommitted to 5.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #5
Darren OhThe Drupal 4.7 Form API works differently, so it doesn't require fixing.
Comment #6
(not verified) CreditAttribution: commented