View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
03394Bug reportsSurvey takingpublic2009-08-31 15:12
Reportermdekker Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.85+ 
Fixed in Version1.85+ 
Summary03394: Drop down datefield incorrect to database
Description

A datefield with the drop down display gets inserted incorrect to my database. I tried with english and dutch locale but both are incorrect. My survey has dutch locale as default language, which should give dd-mm-yyyy as a date format.

When I use the normal datepicker the date gets to the database correctly.

EDIT: Also the drop down field gives a validation error and then without change i can submit.

Additional Information

Changing line 1090 in qanda.php from

<input type="hidden" id="dateformat'.$ia[1].'" value="'.$dateformatdetails['jsdate'].'"/>';

to
<input type="hidden" id="dateformat'.$ia[1].'" value="'.$dateformatdetails['phpdate'].'"/>';

seems to do the trick, please have a look.

TagsNo tags attached.
Attached Files
Clipboard01.jpg (18,572 bytes)   
Clipboard01.jpg (18,572 bytes)   
Clipboard02.jpg (19,687 bytes)   
Clipboard02.jpg (19,687 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & versionMysql
Server OS (if known)FreeBSD
Webserver software & version (if known)apache
PHP Version5.x

Users monitoring this issue

There are no users monitoring this issue.

Activities

user372

2009-06-23 14:32

  ~08641

@ c_schmitz: please review the suggested modification.

mdekker

mdekker

2009-06-23 14:33

reporter   ~08642

changing that line doesn't work... the format should be lowercased I think... for input date day=20 month=6 year=2009 i now get 20.6.Y

c_schmitz

c_schmitz

2009-06-23 15:12

administrator   ~08645

Which build number?

mdekker

mdekker

2009-06-23 15:28

reporter   ~08646

I use latest svn, at the moment I use 07167

c_schmitz

c_schmitz

2009-06-24 11:43

administrator   ~08657

The data is always written in the database in the same format. The only thing you can change in the langage tab is how it is displayed ot the user.

mdekker

mdekker

2009-06-24 12:11

reporter   ~08659

The problem is that the data won't be recorded correctly. It uses three fields for input that need to be transfered to one date field in a particular order. I noticed that only the day and month get into that date field, and mysql doesn't know how to handle a date like "20.6.Y" so I get incorrect dates.

The normal datepicker works ok, but the drop down dates are the problem. I think the problems is in the code where the separate elements are put into one database variable. I don't know the inner workings, but maybe the definition of the databasefield shouldn't be localised at all then, but just yyyy-mm-dd as mysql expects it.

mdekker

mdekker

2009-06-24 13:06

reporter   ~08663

Ok I changed my databse field to be a text field so no conversion done by mysql.

I have 2 languages: english and dutch. I input june 21 2009 and this is what gets into the database:

dutch: 2000-06-21
english: 2000-06-01

Just one other strange thing... the startlanguage is in both cases nl, where i expected to see en for the last case.

A dump on the postvars shows 306 = datepicker, 311 = dropdown
and for dutch:

[18491X67X306] => 21.06.2009
[dateformat18491X67X306] => dd.mm.yy
[datelanguage18491X67X306] => nl
[display18491X67X306] => on

[18491X68X311] => 21.6.Y
[qattribute_answer] => Array([0] => 18491X68X311)
[qattribute_answer18491X68X311] =>
[display18491X68X311] => on

for english:

[18491X67X306] => 06-21-2009
[dateformat18491X67X306] => mm-dd-yy
[datelanguage18491X67X306] => en
[display18491X67X306] => on

[18491X68X311] => 6-21-Y
[qattribute_answer] => Array([0] => 18491X68X311)
[qattribute_answer18491X68X311] =>
[display18491X68X311] => on

c_schmitz

c_schmitz

2009-06-28 13:25

administrator   ~08704

I still can't reproduce.
Can you please attach a small sample survey?

mdekker

mdekker

2009-06-29 10:44

reporter   ~08718

I'm going crazy now... I tried this a hundred times and always got wrong dates in the database and now I try again it just works as it is supposed to.

Ok the problem is a little bit different (I will attach the sample survey in a minute).

When the form validates there is no problem, but when I get a validation warning something goes wrong. It forgets the year for the drop down box. After the first validation error it shows ok on the screen, but after the second submit you can see on screen the year box is empty.

mdekker

mdekker

2009-06-29 10:52

reporter   ~08719

Attached the survey. Try to not answer the mandatory question. Then submit a few times and see what happens.

c_schmitz

c_schmitz

2009-08-19 10:57

administrator   ~09171

I still can't reproduce it.
Can you detail out the exact steps to reproduce using the attached survey?

mdekker

mdekker

2009-08-25 12:33

reporter   ~09208

I'll attach screenshots... I take the survey in Nederlands / Dutch. Don't answer the first question and put in todays date for datepicker and drop down date.

Now submit... (versturen). After you click ok to error message the date in the datepicker is wrong and drop down date is empty.

c_schmitz

c_schmitz

2009-08-27 15:41

administrator   ~09236

Thank you very much. Guess it is fixed now.

Issue History

Date Modified Username Field Change
2009-06-23 12:53 mdekker New Issue
2009-06-23 12:53 mdekker Status new => assigned
2009-06-23 12:53 mdekker Assigned To => user372
2009-06-23 12:53 mdekker Database & DB-Version => Mysql
2009-06-23 12:53 mdekker Operating System (Server) => FreeBSD
2009-06-23 12:53 mdekker Webserver => apache
2009-06-23 12:53 mdekker PHP Version => 5.x
2009-06-23 12:54 mdekker Description Updated
2009-06-23 14:27 mdekker Additional Information Updated
2009-06-23 14:28 mdekker Additional Information Updated
2009-06-23 14:32 user372 Assigned To user372 => c_schmitz
2009-06-23 14:32 user372 Note Added: 08641
2009-06-23 14:33 mdekker Note Added: 08642
2009-06-23 15:12 c_schmitz Note Added: 08645
2009-06-23 15:28 mdekker Note Added: 08646
2009-06-24 11:43 c_schmitz Note Added: 08657
2009-06-24 12:11 mdekker Note Added: 08659
2009-06-24 13:06 mdekker Note Added: 08663
2009-06-28 13:25 c_schmitz Note Added: 08704
2009-06-29 10:44 mdekker Note Added: 08718
2009-06-29 10:51 mdekker File Added: limesurvey_survey_71879.csv
2009-06-29 10:52 mdekker Note Added: 08719
2009-08-19 10:57 c_schmitz Note Added: 09171
2009-08-19 10:57 c_schmitz Status assigned => feedback
2009-08-25 12:33 mdekker Note Added: 09208
2009-08-25 12:33 mdekker File Added: Clipboard01.jpg
2009-08-25 12:33 mdekker File Added: Clipboard02.jpg
2009-08-27 15:41 c_schmitz Note Added: 09236
2009-08-27 15:41 c_schmitz Status feedback => resolved
2009-08-27 15:41 c_schmitz Fixed in Version => 1.85+
2009-08-27 15:41 c_schmitz Resolution open => fixed
2009-08-31 15:12 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking