Posted by pebosi on July 24, 2008 at 9:54am
Jump to:
| Project: | Webform |
| Version: | 5.x-2.1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi,
when creating a new submission the values of day and month are swaped. i create a patch for 5--2 Branch, please review.
regards pebosi
| Attachment | Size |
|---|---|
| date_sorting.patch.txt | 1.58 KB |
Comments
#1
Could you clarify: are the values going into the wrong fields? That is, after you submit, does the day end up in the month as the saved value?
This probably has to do with the changes I made that make Webform mimic the site settings for the date format. We can't just switch the position of the day and month, as it would break all the sites that have been using Webform previous to that change in the 2.1 version. Also "month/day/year" is the standard format in the United States, as little sense as that makes. I think the display of the values is probably fine, but our saving is incorrect when the format is "day/month/year".
In the database, Webform should save:
day: row 0
month: row 1
year: row 2
If it's saving in a different order, we've got a problem.
#2
In both the 2.1 version for D5 and D6, the date component is saving incorrectly if using day/month/year format. We've got a serious problem in that all dates prior to 2.1 were being saved correctly, while dates after 2.1 have been saved in a different order. Without being able to pinpoint when the date component was changed, we've probably got a lot of corrupted databases out there.
To clarify the problem 2.0 and earlier saved dates as such (Apologies, my comment in #1 was not accurate):
row 0: month
row 1: day
row 2: year
If using an international date format (day/month/year) and using 2.1.x, all the dates since have been saved incorrectly as:
row 0: day
row 1: month
row 2: year
Since Webform has no way of telling which row 0's are days and which are months, all the collected dates using the 2.1 version of Webform are going to be screwed up.
I've committed the following patches to correct this problem, and I'm going to get 2.1.3 out to fix this rather severe problem.
D5: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/webform/compo...
D6: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/webform/compo...
#3
Automatically closed -- issue fixed for two weeks with no activity.