View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
09462 | Bug reports | Expression Manager | public | 2015-01-16 20:51 | 2015-08-04 15:10 |
Reporter | gtrudel | Assigned To | c_schmitz | ||
Priority | high | Severity | partial_block | ||
Status | closed | Resolution | unable to reproduce | ||
Product Version | 2.05+ | ||||
Summary | 09462: Regular expressions for validating fields in questions disappear at the survey level | ||||
Description | After adding email and phone regular expression validations through the expression manager for certain questions, tests will work at the question and group level, but not at the survey level. At the survey level, the regular expressions are gone from the generated JavaScript code. | ||||
Steps To Reproduce | Add regular expressions to validate email and phone number inputs (as subquestions to a survey question) as follows: | ||||
Additional Information | Issue is the same on Chrome and FireFox browsers. Used FireBug to validate that the JavaScript regex code in survey_runtime.js disappears when testing the survey in its entirety, but is there at the question and question group level. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 141229 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Chrome 39.0.2171.95 m | ||||
Database type & version | MySQL 5.0.11 | ||||
Server OS (if known) | Windows 7 Enterprise | ||||
Webserver software & version (if known) | Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 | ||||
PHP Version | 5.5.9 | ||||
It appears that regular expressions (regexMatch) do not work for question validation equations. However, they do work for question validation tips. |
|
New information: Validation expressions when applied to sub-questions on the first screen for validation tips will not apply if the survey does not have a welcome screen. Once you add a welcome screen, then the immediate validation tips work. |
|
Found the problem: Line 386 of \application\helpers\SurveyRuntimeHelper.php was $moveResult = LimeExpressionManager::GetLastMoveResult(true); which executed if this was true: if (!isset($moveResult) && !($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] == 0)). Where there was no welcome screen, that evaluated to true and resulted in a first page that did not have all the validation expressions in it. The stack trace to insert the proper EM code (which only occurs when there is a welcome page for the survey) as JavaScript is as follows: To fix, I commented out line 386 and inserted: It is too bad I am not able to change the status or priority of my own bug. This is now resolved. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=14880 |
|
Can you please test the patch above and give us feedback? Code change is minimal, please revert your own code change before you apply ours. |
|
I tested your fix which was different to mine. It did not work. After publishing my survey with no welcome page, the EM failed to kick in to immediately validate my email field when I started to type something in on the first page. |
|
I cannot reproduce your problem using the latest version. Can you create a short sample survey where YOU can reproduce it easily and attach it here? |
|
I am sorry you are unable to reproduce this problem, and I am not sure what else I can do to assist you. Our version of LimeSurvey works just fine with the fix I provided, so perhaps something changed in the latest version that already fixed it in another way? My apologies, but I do not have the time to look into this, so I would suggest you just close this issue unless or until this comes up again. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2015-01-16 20:51 | gtrudel | New Issue | |
2015-01-16 20:51 | gtrudel | File Added: limesurvey_survey_423489 (1).lss | |
2015-01-20 14:38 | gtrudel | Issue Monitored: gtrudel | |
2015-01-20 16:53 | gtrudel | Note Added: 31472 | |
2015-01-23 19:24 | gtrudel | Note Added: 31484 | |
2015-01-23 20:55 | gtrudel | Note Added: 31485 | |
2015-01-28 17:07 | c_schmitz | Changeset attached | => LimeSurvey master 27dd87ff |
2015-01-28 17:07 | c_schmitz | Note Added: 31517 | |
2015-01-28 17:07 | c_schmitz | Assigned To | => c_schmitz |
2015-01-28 17:07 | c_schmitz | Resolution | open => fixed |
2015-01-28 17:08 | c_schmitz | Note Added: 31518 | |
2015-01-28 17:08 | c_schmitz | Status | new => feedback |
2015-01-28 17:08 | c_schmitz | Note Edited: 31518 | |
2015-01-28 17:31 | gtrudel | Note Added: 31520 | |
2015-01-28 17:31 | gtrudel | Status | feedback => assigned |
2015-05-08 15:10 | c_schmitz | Note Added: 32145 | |
2015-05-08 15:10 | c_schmitz | Status | assigned => feedback |
2015-05-08 15:30 | gtrudel | Note Added: 32146 | |
2015-05-08 15:30 | gtrudel | Status | feedback => assigned |
2015-08-04 15:10 | c_schmitz | Status | assigned => closed |
2015-08-04 15:10 | c_schmitz | Resolution | fixed => unable to reproduce |
2021-08-02 21:05 | guest | Bug heat | 4 => 6 |