View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
13001Bug reportsExpression Managerpublic2019-10-09 12:16
Reporteroc25 Assigned ToDenisChenu  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.7x.x 
Fixed in Version4.0.0dev 
Summary13001: Expression Manager evaluates answers to free text questions enclosed by "{" and "}"
Description

I created 3 questions with Short free text, Long free text and Huge free text.

If I enter {1+2+3+4} as answers, the answers become 10 when the page is displayed again due to some validation errors.

Steps To Reproduce
  1. import the attached survey
  2. execute the survey
  3. put "{1+2+3+4}" as the answers to the first 3 questions and do not answer the yes / no question
  4. click "submit" and system will prompt for missing mandatory answers
  5. all answers become "10"
TagsNo tags attached.
Attached Files
1.PNG (20,252 bytes)   
1.PNG (20,252 bytes)   
2.PNG (27,213 bytes)   
2.PNG (27,213 bytes)   
Bug heat10
Complete LimeSurvey version number (& build)Version 2.72.6+171207
I will donate to the project if issue is resolvedNo
BrowserChrome 62.0.3202.94
Database type & versionMySql
Server OS (if known)Windows 2012 Server
Webserver software & version (if known)Apache 2.4.12
PHP Version5.5.25

Relationships

parent of 14698 closedDenisChenu Expression manager must not treat user entered value 
related to 13925 assignedLouisGac Unable to use QID SGQ … in validation equation tip 

Users monitoring this issue

duvemyster

Activities

oc25

oc25

2017-12-09 20:28

reporter   ~45272

Maybe we can escape the "{" and "}" characters again in the return value of $this->GetResult() ?

em_core_helper.php - Line 1944:
$resolvedPart = $this->GetResult();

DenisChenu

DenisChenu

2017-12-16 11:44

developer   ~45314

2.6lts have the same issue, the real issue is EM core didn't know what he receive at this time (he receive EXPRESSION, not a variable)

Hard to fix but must find a way …

DenisChenu

DenisChenu

2017-12-16 12:10

developer   ~45315

Potential fix : https://github.com/LimeSurvey/LimeSurvey/pull/899

ollehar

ollehar

2018-02-20 15:03

administrator   ~46617

We need unit-tests for this. I can make them when I have time, or you can make them, Denis?

ollehar

ollehar

2018-02-20 15:07

administrator   ~46618

Just to outline, the unit tests need to:

  1. Test expression in default value.
  2. Test normal non-expression default value.
  3. Test expression in text question.
  4. Test normal non-expression in text question.
  5. Test normal expression in expression question to make sure it's not broken by other changes/fixes.
DenisChenu

DenisChenu

2018-02-20 15:18

developer   ~46620

Maye be test to : EM contain value entered by user (example with strpos { or } ?)

DenisChenu

DenisChenu

2018-04-03 13:38

developer   ~47313

Issue was here : https://github.com/LimeSurvey/LimeSurvey/blob/58bcd794fef429fcf5c3a2fc3dbc07400c067ec5/application/helpers/SurveyRuntimeHelper.php#L390

We need EM only for subquestion text and answer text (static for dropdown) not for whole ANSWERS

DenisChenu

DenisChenu

2018-04-11 12:07

developer   ~47399

Can not fix it in 3.X, target version 4.X

user70560

2018-09-26 17:28

  ~49147

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

DenisChenu

DenisChenu

2018-10-16 17:29

developer   ~49343

fixed in develop

ollehar

ollehar

2019-10-09 11:43

administrator   ~53964

This fix MAYBE breaks ranking with min/max (no mandatory). We NEED a test for this, so that one fix doesn't break the other.

DenisChenu

DenisChenu

2019-10-09 11:58

developer   ~53965

Since this fix update ALL twig file : this fix can broke a lot more things …

ollehar

ollehar

2019-10-09 12:16

administrator   ~53967

Yep. Hard to know. :)

Related Changesets

LimeSurvey: develop 9c055e54

2018-09-26 19:28

user70560

Committer: GitHub


Details Diff
Fixed issue 13001: EM evaluates free text answers enclosed by "{ }"

Dev: Fixed issue 13913: Some replacementfieds not accessible in help-text
Fixed issue 14047: Equation didn't update previous text
Affected Issues
13001, 13913, 14047
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - application/views/survey/questions/answer/arrays/10point/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/10point/rows/cells/answer_td_input.twig Diff File
mod - application/views/survey/questions/answer/arrays/5point/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/5point/rows/cells/answer_td_answertext.twig Diff File
mod - application/views/survey/questions/answer/arrays/5point/rows/cells/answer_td_input.twig Diff File
mod - application/views/survey/questions/answer/arrays/array/dropdown/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/array/no_dropdown/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/array/no_dropdown/rows/cells/answer_td.twig Diff File
mod - application/views/survey/questions/answer/arrays/column/answer.twig Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer.twig Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer_dropdown.twig Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer_header.twig Diff File
mod - application/views/survey/questions/answer/arrays/increasesamedecrease/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/answer.twig Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/cells/answer_td.twig Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/cells/answer_td_checkboxes.twig Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/repeat_header.twig Diff File
mod - application/views/survey/questions/answer/arrays/texts/answer.twig Diff File
mod - application/views/survey/questions/answer/arrays/texts/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/arrays/texts/rows/cells/answer_td.twig Diff File
mod - application/views/survey/questions/answer/arrays/texts/rows/repeat_header.twig Diff File
mod - application/views/survey/questions/answer/arrays/yesnouncertain/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/date/selector/answer.twig Diff File
mod - application/views/survey/questions/answer/equation/answer.twig Diff File
mod - application/views/survey/questions/answer/file_upload/answer.twig Diff File
mod - application/views/survey/questions/answer/global/table/cell/head_header.twig Diff File
mod - application/views/survey/questions/answer/global/table/cell/head_information.twig Diff File
mod - application/views/survey/questions/answer/list_dropdown/rows/optgroup.twig Diff File
mod - application/views/survey/questions/answer/list_dropdown/rows/option.twig Diff File
mod - application/views/survey/questions/answer/list_dropdown/rows/othertext.twig Diff File
mod - application/views/survey/questions/answer/list_with_comment/dropdown/answer.twig Diff File
mod - application/views/survey/questions/answer/list_with_comment/dropdown/rows/option.twig Diff File
mod - application/views/survey/questions/answer/list_with_comment/list/answer.twig Diff File
mod - application/views/survey/questions/answer/list_with_comment/list/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/listradio/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/listradio/rows/answer_row_other.twig Diff File
mod - application/views/survey/questions/answer/multiplechoice/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/multiplechoice/rows/answer_row_other.twig Diff File
mod - application/views/survey/questions/answer/multiplechoice_with_comments/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/multiplechoice_with_comments/rows/answer_row_other.twig Diff File
mod - application/views/survey/questions/answer/multiplenumeric/rows/dynamic.twig Diff File
mod - application/views/survey/questions/answer/multiplenumeric/rows/dynamic_slider.twig Diff File
mod - application/views/survey/questions/answer/multiplenumeric/rows/input/answer_row.twig Diff File
mod - application/views/survey/questions/answer/multiplenumeric/rows/sliders/answer_row.twig Diff File
mod - application/views/survey/questions/answer/multipleshorttext/rows/answer_row_inputtext.twig Diff File
mod - application/views/survey/questions/answer/multipleshorttext/rows/answer_row_textarea.twig Diff File
mod - application/views/survey/questions/answer/numerical/answer.twig Diff File
mod - application/views/survey/questions/answer/ranking/answer.twig Diff File
mod - application/views/survey/questions/answer/ranking/rows/answer_row.twig Diff File
mod - application/views/survey/questions/answer/shortfreetext/text/item.twig Diff File
mod - application/views/survey/questions/answer/shortfreetext/textarea/item.twig Diff File
mod - assets/packages/expressions/em_javascript.js Diff File
mod - tests/data/surveys/limesurvey_survey_351443.lss Diff File

Issue History

Date Modified Username Field Change
2017-12-09 20:11 oc25 New Issue
2017-12-09 20:11 oc25 File Added: limesurvey_survey_322944.lss
2017-12-09 20:15 oc25 File Added: 1.PNG
2017-12-09 20:15 oc25 File Added: 2.PNG
2017-12-09 20:28 oc25 Note Added: 45272
2017-12-11 15:55 DenisChenu Severity minor => partial_block
2017-12-16 11:44 DenisChenu Note Added: 45314
2017-12-16 12:10 DenisChenu Assigned To => DenisChenu
2017-12-16 12:10 DenisChenu Status new => assigned
2017-12-16 12:10 DenisChenu Note Added: 45315
2017-12-20 21:31 DenisChenu Target Version => 3.0.x
2018-01-16 15:11 DenisChenu Priority none => high
2018-02-20 15:03 ollehar Note Added: 46617
2018-02-20 15:07 ollehar Note Added: 46618
2018-02-20 15:18 DenisChenu Note Added: 46620
2018-04-03 13:38 DenisChenu Note Added: 47313
2018-04-11 12:07 DenisChenu Target Version 3.0.x =>
2018-04-11 12:07 DenisChenu Note Added: 47399
2018-04-27 17:42 duvemyster Issue Monitored: duvemyster
2018-08-01 10:24 DenisChenu Relationship added related to 13925
2018-09-26 17:28 user70560 Changeset attached => LimeSurvey develop 9c055e54
2018-09-26 17:28 user70560 Note Added: 49147
2018-09-26 17:28 user70560 Assigned To DenisChenu => user70560
2018-09-26 17:28 user70560 Resolution open => fixed
2018-10-16 17:29 DenisChenu Status assigned => resolved
2018-10-16 17:29 DenisChenu Note Added: 49343
2018-10-16 17:30 DenisChenu Fixed in Version => 4.0.0dev
2019-04-30 09:10 c_schmitz Status resolved => closed
2019-06-04 11:38 DenisChenu Relationship added parent of 14698
2019-10-09 11:43 ollehar Note Added: 53964
2019-10-09 11:43 ollehar Relationship added related to 15385
2019-10-09 11:58 DenisChenu Note Added: 53965
2019-10-09 12:16 ollehar Note Added: 53967
2019-10-09 12:16 ollehar Relationship deleted related to 15385