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.
Date popup fields get wiped out, when there is a validation error and sometimes on submit.
Reproduce example: Edit a Timetracking with a date and clear the title. Now there is a validation error (no title) and the date is wiped out. (date_popup Module has to be enabled.)
Patch follows.
Comment | File | Size | Author |
---|---|---|---|
#4 | storm_date-1418656-4.patch | 1.27 KB | kfritsche |
#1 | storm_date-1418656-1.patch | 1.27 KB | kfritsche |
Comments
Comment #1
kfritscheI checked the date module. When the date popup is added through a process function, it sets the default_value and not the value.
If the value is set, the edit array in date_popup_process is empty.
After the patch, the default_value is used instead of the value.
This fixes the problem for me.
Comment #2
juliangb CreditAttribution: juliangb commentedThe date handling is an area I don't know very much about.
Just to ask, does this affect 1.x, or is it a recently introduced bug?
Comment #3
kfritscheI think this affects 1.x too.
The bug is introduced in date 6.x-2.8. Somehow they handle things differently now. But this patch works for date 6.x-2.7 as well. As far as i understand date module, now it is the way it should be done...
I would commit this today and create another patch for 6.x-1.x...
Comment #4
kfritschecommitted for 6.x-2.x
Here a rerolled patch against 6.x-1.x
Comment #5
kfritschecommitted to 6.x-1.x
Comment #6.0
(not verified) CreditAttribution: commentedAdded reproduce example