View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
08678 | Bug reports | Survey editing | public | 2014-02-06 22:02 | 2018-02-22 14:18 |
Reporter | Jondays | Assigned To | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.06+ | ||||
Summary | 08678: Using Expressions as default value for text fields questions when index is activated | ||||
Description | When using expressions as default values for text fields (to populate text box with answers from previous questions in previous groups), the expressions don't get filled. For example, in question group 1, you answer Q1 to Q5. In Group 2 you have a question with a large text box. You set the default value as {Q1.shown}, {Q2.shown}, {Q3.shown}, {Q4.shown}, {Q5.shown}. When you run the survey, when you answer group 1, and then click next, you will see in text box: , , , | ||||
Steps To Reproduce | See .lss file for a "working" example of the bug. Create a group with your questions. In a second group, create a text field question. In the default value text box enter the expression (as above). Try the survey. In the forum, tpartner suggested that this issue may be happening only one the index feature is enabled: http://www.limesurvey.org/en/forum/design-issues/95939-using-expressions-as-default-value-in-free-text-field#104721 | ||||
Additional Information | The attached dummy survey reproduces the error | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | Version 2.05+ Build 140204 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Chrome, IE, Firefox, all of them | ||||
Database type & version | MySQL Server 5.1 | ||||
Server OS (if known) | Windows NT 6.1 build 7600 (Windows Server 2008 R2 Standard Edition) i586 | ||||
Webserver software & version (if known) | Windows NT 6.1 build 7600 (Windows Server 2008 R2 Standard Edition) i586 | ||||
PHP Version | PHP Version 5.4.14 | ||||
This only happens if the question index is set to full. |
|
First impression: var_dumping the session variable shows that the values of the previous questions are correctly saved (bot in question index full or disabled). |
|
In SurveyRuntimeHelper::createFullQuestionIndexByGroup(), this snippet cause the bug: $stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key); |
|
after further investigation, the problem is deeper than it seemed: Even with no index:
Maybe we should document about it, saying that for now, using expression should not be done in survey allowing "Previous" or "Index" |
|
after a discussion with Carsten, it seems that the wanted behavior (default values is used only the first time) |
|
So, here my bet: the function _ValidateGroup is called at the very start of the survey, to build the menu. Doing it, it's saving the (empty) values of the answer to session, overriding the default values. Possible solution: |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=20241 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=20264 |
|
Version 2.51.0 Build 160829 released |
|
LimeSurvey: master 44cbdd16 2016-08-25 15:40
Details Diff |
Fixed issue 08678: Using Expressions as default value for text fields questions when index is activated |
Affected Issues 08678 |
|
mod - application/helpers/SurveyRuntimeHelper.php | Diff File | ||
LimeSurvey: master 3748d294 2016-08-26 13:00
Details Diff |
Dev: few cleanings, removed for now the fix of 08678 (need to add the array aQuestionsWithDependencies the questions with conditions) |
Affected Issues 08678 |
|
mod - application/config/internal.php | Diff File | ||
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
mod - scripts/survey_runtime.js | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-02-06 22:02 | Jondays | New Issue | |
2014-02-06 22:02 | Jondays | File Added: limesurvey_survey_465241.lss | |
2014-02-06 22:05 | Jondays | Issue Monitored: Jondays | |
2014-02-16 17:37 | c_schmitz | Assigned To | => c_schmitz |
2014-02-16 17:37 | c_schmitz | Status | new => assigned |
2014-02-16 17:40 | c_schmitz | Assigned To | c_schmitz => sammousa |
2014-02-16 17:41 | c_schmitz | Note Added: 28764 | |
2016-01-20 11:00 | sammousa | Assigned To | sammousa => |
2016-01-21 09:09 | DenisChenu | Status | assigned => new |
2016-03-15 11:33 |
|
Product Version | => 2.06+ |
2016-08-25 11:43 |
|
Sticky Issue | No => Yes |
2016-08-25 12:13 |
|
Note Added: 40490 | |
2016-08-25 13:26 |
|
Note Added: 40493 | |
2016-08-25 14:37 |
|
Note Added: 40495 | |
2016-08-25 14:37 |
|
Note Edited: 40495 | |
2016-08-25 14:45 |
|
Note Added: 40496 | |
2016-08-25 15:15 |
|
Note Added: 40497 | |
2016-08-25 15:40 |
|
Changeset attached | => LimeSurvey master 44cbdd16 |
2016-08-25 15:40 |
|
Note Added: 40499 | |
2016-08-25 15:40 |
|
Assigned To | => LouisGac |
2016-08-25 15:40 |
|
Resolution | open => fixed |
2016-08-25 16:18 |
|
Status | new => resolved |
2016-08-26 13:00 |
|
Changeset attached | => LimeSurvey master 3748d294 |
2016-08-26 13:00 |
|
Note Added: 40520 | |
2016-08-29 12:38 | c_schmitz | Note Added: 40529 | |
2016-08-29 12:38 | c_schmitz | Status | resolved => closed |
2018-02-22 14:18 | c_schmitz | Sticky Issue | Yes => No |
2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |
2021-08-03 03:44 | guest | Bug heat | 4 => 6 |