View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
03800Bug reports[All Projects] Survey takingpublic2009-10-28 14:502009-11-28 13:45
Assigned Toc_schmitz 
Product Version1.86 
Target VersionFixed in Version1.87RC3 
Summary03800: Condition comparison of dates fails
DescriptionA condition that compares a date entered in a previous question to a date constant or date entered in a token field does not work as expected.

The survey's date format is yyyy/mm/dd. When I display the precious answer in the body of a subsequent question, it is displayed with format

Conditional comparisons for "less than" and "equals" do not work. I have not tested others.

The conditions worked as expected in most recent 1.85+.
Additional InformationSee the sample survey file attached.

Complete LimeSurvey version number (& build)7697
I will donate to the project if issue is resolved
BrowserFF, IE
Database & DB-VersionMySql
Operating System (Server)Win 2K3,
Webserver software & versionApache
PHP Version5.1.4
Attached Filescsv file icon limesurvey_survey_73529.csv [^] (4,575 bytes) 2009-10-28 14:50

- Relationships

-  Notes
2009-10-28 16:38

I get the following notices, if I run the attached survey:
Notice: Undefined variable: thistype in /home/.sites/962/site989/web/limesurvey/common.php on line 6142

Notice: Undefined variable: thistype in /home/.sites/962/site989/web/limesurvey/common.php on line 6142

Notice: Undefined variable: cq_gid in /home/.sites/962/site989/web/limesurvey/common.php on line 6158

Notice: Undefined variable: cq_gid in /home/.sites/962/site989/web/limesurvey/common.php on line 6286
lemeur (developer)
2009-10-28 22:06

This is no bug, you juste have to use YYY-MM-DD format as the constant value because conditions are independant on the date-format defined in a specific language of a survey.

I've updated Documentation. [^]
bkgray (reporter)
2009-10-28 22:55

Thanks, lemeur. I changed the date constants to the correct format and it fixed the problem. Oddly, if I display the value of the entered date in the text of a subsequent question (using INSERTANS), the date is displayed as

Also, in the survey I uploaded (with the date constant modified to the correct format) and with $debug = 1, I still get the four undefined variable error messages in one case on question code q4.

The condition on q4 is <date> not equal to 2009-10-28. If I enter another date in the previous question, the condition is triggered and I get the appropriate message, but the screen also shows the four error message.

Thanks for the quick answer!

lemeur (developer)
2009-10-28 23:04

the error message you see is because your survey structure contains a strange condition for question q4: it has cqid field set to '0' which is not normal...

Juste delete the condition and create it again, this should fix the issue.
lemeur (developer)
2009-10-28 23:33

Carsten, I assign this one to you: the remaining issue is about the format used to display INSERTANS: answers corresponding to date questions.

It seems that the getextendedanswer() function in common.php always returns a d.m.Y date format

getextendedanswer($fieldcode, $value, $format='', $dateformatphp='d.m.Y')

line 2047:
     $datetimeobj = new Date_Time_Converter($value , "Y-m-d H:i:s");

Do you think we should change this ?
c_schmitz (administrator)
2009-11-22 20:19

Fixed remaining issues with INSERTANS

- Issue History
Date Modified Username Field Change
2009-10-28 14:50 bkgray New Issue
2009-10-28 14:50 bkgray Status new => assigned
2009-10-28 14:50 bkgray Assigned To => user372
2009-10-28 14:50 bkgray File Added: limesurvey_survey_73529.csv
2009-10-28 14:50 bkgray LimeSurvey build number => 7697
2009-10-28 14:50 bkgray Browser => FF, IE
2009-10-28 14:50 bkgray Database & DB-Version => MySql
2009-10-28 14:50 bkgray Operating System (Server) => Win 2K3,
2009-10-28 14:50 bkgray Webserver => Apache
2009-10-28 14:50 bkgray PHP Version => 5.1.4
2009-10-28 16:38 user372 Note Added: 09896
2009-10-28 16:38 user372 Assigned To user372 => lemeur
2009-10-28 22:06 lemeur Note Added: 09908
2009-10-28 22:55 bkgray Note Added: 09910
2009-10-28 23:04 lemeur Note Added: 09911
2009-10-28 23:31 lemeur Assigned To lemeur => c_schmitz
2009-10-28 23:33 lemeur Note Added: 09912
2009-11-22 20:19 c_schmitz Note Added: 10207
2009-11-22 20:19 c_schmitz Status assigned => resolved
2009-11-22 20:19 c_schmitz Fixed in Version => 1.87RC3
2009-11-22 20:19 c_schmitz Resolution open => fixed
2009-11-28 13:45 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking

Copyright © 2000 - 2016 MantisBT Team
Powered by Mantis Bugtracker