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 commentedYup.
Comment #3
drummCommitted to 5.
Comment #4
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) commented