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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kfritsche’s picture

Title: Date field get wiped out » Date popup fields get wiped out
Status: Active » Needs review
FileSize
1.27 KB

I 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.

juliangb’s picture

The 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?

kfritsche’s picture

I 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...

kfritsche’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
FileSize
1.27 KB

committed for 6.x-2.x

Here a rerolled patch against 6.x-1.x

kfritsche’s picture

Status: Needs review » Fixed

committed to 6.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Added reproduce example