View Issue Details

IDProjectCategoryView StatusLast Update
14281Bug reports[All Projects] Survey designpublic2019-01-25 13:49
ReporterswflngAssigned ToLouisGac 
PrioritynoneSeveritymajor 
Status assignedResolutionopen 
Product Version3.15.x 
Target VersionFixed in Version 
Summary14281: Silently changes question conditions of all questions if one single question was changed
Description

I've created a survey based on two OR conditions. Only one of the two conditions can fulfilled at a time.

Whenever I change a detail inside a survey question, the OR conditions change to AND. As a result, all participants of the survey will never see this question, if I do not change them all manually after each change.

Steps To Reproduce
  1. Create survey
  2. Create question group
  3. Create participant table
  4. Create new attribute

Go to question group:

  1. Create question
  2. Create condition for question:
    • If (attribute_1 == "valuea") OR (attribute_1 == "valueb")
  3. Repeat steps 5-6 multiple times

Trigger bug:

  1. Select one of these questions

  2. Change text of the question or something else (e.g. text/variable names of subquestions)

  3. After that, the conditions of all but one question changed to:

    • If (attribute_1 == "valuea") AND (attribute_1 == "valueb")
Additional Information

The two survey files (before and after) are attached. Note that the OR conditions change to AND even during importing the file, so they will appear identical after the import.

Differences between the files:

diff Bug-Report(before\ change).lss Bug-Report(after\ change).lss
154c154
< <relevance><![CDATA[((TOKEN:ATTRIBUTE_1 == "attr1" or TOKEN:ATTRIBUTE_1 == "attr2"))]]></relevance>

&lt;relevance>&lt;![CDATA[((TOKEN:ATTRIBUTE_1 == &quot;attr1&quot;) and (TOKEN:ATTRIBUTE_1 == &quot;attr2&quot;))]]>&lt;/relevance>

163c163
< <question><![CDATA[Question 3]]></question>

&lt;question>&lt;![CDATA[Question 3 with new text]]>&lt;/question>

172c172,173
< <relevance><![CDATA[((TOKEN:ATTRIBUTE_1 == "attr1" or TOKEN:ATTRIBUTE_1 == "attr2"))]]></relevance>

&lt;relevance>&lt;![CDATA[((TOKEN:ATTRIBUTE_1 == &quot;attr1&quot;) and (TOKEN:ATTRIBUTE_1 == &quot;attr2&quot;))]]>&lt;/relevance>
&lt;modulename/>
TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.15.5+181115
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMySQL 5.7.24-0ubuntu0.16.04.1 (Ubuntu)
Server OS (if known)Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-130-generic x86_64)
Webserver software & version (if known)Apache/2.4.18 (Ubuntu)
PHP VersionPHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS )

Activities

swflng

swflng

2018-11-23 15:23

reporter  

Bug-Report_(after change).lss (20,165 bytes)
Bug-Report_(before change).lss (20,127 bytes)
LouisGac

LouisGac

2019-01-16 12:00

manager   ~50216

thank you for that detailed bug report, highly

but:

  1. I can't reproduce
  2. Both lss are identicals

So I think the bug is not real, but you just get confused. I let the bug opened in case I'm missing something and you want to tell it.
What ever: thank you again for that excellent bug report, clear, with steps to reproduce, and lss files :ok:

swflng

swflng

2019-01-16 12:49

reporter   ~50217

The lss files are not identical. The differences are in lines 154, 163 and 172: "Bug-Report(before change).lss" has AND conditions in these lines, while "Bug-Report(after change).lss" has OR conditions in these lines.

But: Since the affected limesurvey version also changes OR conditions to AND conditions when importing files, both files will, of course, result in the same survey when they are imported (which is not the expected behavior).

LouisGac

LouisGac

2019-01-16 14:42

manager   ~50218

"limesurvey version also changes OR conditions to AND conditions when importing files" ?
really? That would be very nasty. I will check now.
can you try to reproduce your bug in your side? Maybe on a limesurvey free online installation?

LouisGac

LouisGac

2019-01-16 14:57

manager   ~50220

ok I confirm that conditions from the lss is changed after import.
Thank you again for that report.

swflng

swflng

2019-01-16 15:06

reporter   ~50222

I'm able to confirm this bug on a fresh install. Question 2 and Question 3 change after import.

LouisGac

LouisGac

2019-01-16 15:12

manager   ~50223

ok so I've just tested with a 2.06, and the bug exists too. So it's going to be hard one to fix.... :(
I don't understand how nobody noticed this bug in so many year.
I will try again by following your steps to reproduce, it will probably help to understand where does it come from.

DenisChenu

DenisChenu

2019-01-25 13:47

developer   ~50313

Last edited: 2019-01-25 13:49

View 2 revisions

After import : when view Question2 ( that rae set to AND when import) : reset to OR, add a condition, remove this condition : OK after.

Bad reset of condition to question->relevance (not the god function used) .Don't remind where is the good function (currently)

See if https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L784 is OK

Issue History

Date Modified Username Field Change
2018-11-23 15:23 swflng New Issue
2018-11-23 15:23 swflng File Added: Bug-Report_(after change).lss
2018-11-23 15:23 swflng File Added: Bug-Report_(before change).lss
2019-01-10 16:40 LouisGac Assigned To => markusfluer
2019-01-10 16:40 LouisGac Status new => assigned
2019-01-16 11:03 LouisGac Assigned To markusfluer => LouisGac
2019-01-16 12:00 LouisGac Note Added: 50216
2019-01-16 12:49 swflng Note Added: 50217
2019-01-16 14:42 LouisGac Note Added: 50218
2019-01-16 14:57 LouisGac Note Added: 50220
2019-01-16 15:06 swflng Note Added: 50222
2019-01-16 15:12 LouisGac Note Added: 50223
2019-01-25 13:47 DenisChenu Note Added: 50313
2019-01-25 13:49 DenisChenu Note Edited: 50313 View Revisions