View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
11753Bug reportsSurvey takingpublic2016-10-18 15:57
ReporterMazi Assigned Toollehar  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.53 
Target Version2.54Fixed in Version2.55.x 
Summary11753: Date validation issues
Description

When validating dates the following issues show u:

  1. If you reference a previous (date) question to define the MIN allowed date at the advanced question settings, question preview shows JS errors ("Uncaught TypeError: minDate() Could not parse date parameter: {d1.NAOK}") and thus other date validations fail.
    This is due to the fact that the used placeholder won't work for question preview.

  2. If you set a MIN and MAX date and enter a correct date, the validation still marks the date input in red though it is correct. See attached screen shot.
    Users can proceed with the survey but the validation error is confusing.

Steps To Reproduce
  1. Import the attached test survey.
  2. Use question preview for question "d2" for issue #1.
  3. Run the survey and enter a date like yesterday at "d1" and a valid date at "d2" to see the wrong validation flagging correct input as invalid/red.
TagsNo tags attached.
Attached Files
wrong_date_validation.png (13,573 bytes)   
wrong_date_validation.png (13,573 bytes)   
Bug heat6
Complete LimeSurvey version number (& build) 2.53+161004
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL 5
Server OS (if known)Linux
Webserver software & version (if known)Apache 2
PHP Version5.5

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2016-10-13 15:32

administrator   ~41306

Question ID for second question is 12003. LEMval12003 is called three times when validating this question. but third time, jsName is "java757229X761X12002", and 12002 is the ID of the previous question. sdatetimePattern is undefined third time.

ollehar

ollehar

2016-10-13 15:33

administrator   ~41307

Function LEMval from em_javacript.js is used to validate.

ollehar

ollehar

2016-10-13 15:51

administrator   ~41310

Another problem: When running survey group by group, second datepicker won't work because of a JS error:

Uncaught TypeError: minDate() Could not parse date parameter: {d1.NAOK}

ollehar

ollehar

2016-10-13 15:59

administrator   ~41311

Last edited: 2016-10-13 16:03

This line in qandas return null, even when $date_min = 'd1.NAOK'.

918: $date_time_em = strtotime(LimeExpressionManager::ProcessString("{".$date_min."}",$ia[0]));

But only when running group-by-group.

ollehar

ollehar

2016-10-13 16:16

administrator   ~41312

FYI, it works in 2.06lts to run it group-by-group. The validation is correct, even when calculated dynamically.

ollehar

ollehar

2016-10-13 17:03

administrator   ~41313

Running

LEMval('d1.NAOK')

in the console on the second page returns a date in 2.06lts, but 'Invalid date' in 2.5.

DenisChenu

DenisChenu

2016-10-13 17:45

developer   ~41314

@aestu work hard to have a functionnal way with jquery-ui date ... but we quit jquery-ui date ....

Maybe he can have some advice (he was the DEV about all of this)

ollehar

ollehar

2016-10-14 11:42

administrator   ~41344

Please pull and test, Mazi.

ollehar

ollehar

2016-10-14 11:44

administrator   ~41345

There's still an issue where it's possible to submit wrong date, question-by-question.

ollehar

ollehar

2016-10-14 12:03

administrator   ~41346

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=21018

c_schmitz

c_schmitz

2016-10-18 15:57

administrator   ~41432

Version 2.54.4 released

Related Changesets

LimeSurvey: master 0ef881cf

2016-10-14 11:41:50

ollehar

Details Diff
Fixed issue 11753: Date validation issues Affected Issues
11753
mod - scripts/expressions/em_javascript.js Diff File

Issue History

Date Modified Username Field Change
2016-10-05 21:39 Mazi New Issue
2016-10-05 21:39 Mazi File Added: wrong_date_validation.png
2016-10-05 21:39 Mazi File Added: limesurvey_survey_757229.lss
2016-10-13 15:30 ollehar Assigned To => ollehar
2016-10-13 15:30 ollehar Status new => assigned
2016-10-13 15:32 ollehar Note Added: 41306
2016-10-13 15:33 ollehar Note Added: 41307
2016-10-13 15:51 ollehar Note Added: 41310
2016-10-13 15:59 ollehar Note Added: 41311
2016-10-13 16:00 ollehar Note Edited: 41311
2016-10-13 16:00 ollehar Note Edited: 41311
2016-10-13 16:03 ollehar Note Edited: 41311
2016-10-13 16:16 ollehar Note Added: 41312
2016-10-13 17:03 ollehar Note Added: 41313
2016-10-13 17:45 DenisChenu Note Added: 41314
2016-10-14 11:42 ollehar Status assigned => feedback
2016-10-14 11:42 ollehar Note Added: 41344
2016-10-14 11:44 ollehar Note Added: 41345
2016-10-14 12:03 ollehar Changeset attached => LimeSurvey master 0ef881cf
2016-10-14 12:03 ollehar Note Added: 41346
2016-10-14 12:03 ollehar Resolution open => fixed
2016-10-14 12:07 ollehar Status feedback => resolved
2016-10-14 12:07 ollehar Fixed in Version => 2.55.x
2016-10-18 15:57 c_schmitz Note Added: 41432
2016-10-18 15:57 c_schmitz Status resolved => closed