View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
05819Bug reportsSurvey takingpublic2012-03-14 21:08
Reporteruser15046Assigned ToTMSWhite  
PriorityimmediateSeveritycrash 
Status closedResolutionfixed 
Product Version1.92RC3 
Target Version1.92RC5Fixed in Version1.92RC5 
Summary05819: Survey with token activated. When users go back on an uncompleted survey, they get an error and cannot continue.
Description

Survey with token activated. Lots of conditions and mandatory questions.
When users close their browser before submitting their answer and then go back on the uncompleted survey using their personal link (with token), they get the following message:
"Warning: Invalid argument supplied for foreach() in /home/dready/www/limesurvey/classes/eval/LimeExpressionManager.php on line 4668"

The user can click on "Exit and clear survey" and then start again from the beginning but then loose all their answers.

Steps To Reproduce

If the first page of the survey is not filled completely, when going back on it afterward, the error appear.

Survey presented group-by-group.
In the first group 7 questions:
Q1 Multiple text entry - Mandatory (default value inserted from the token database)
Q2 Boilerplate question
Q3 Date question - Mandatory with the following snippet to hide day and month value and set them to 1: http://www.limesurvey.org/en/forum/can-i-do-this-with-limesurvey/54706-is-there-a-way-to-ask-for-a-month-and-year-in-a-single-question
Q4 Multiple short text - Mandatory - number only
Q5 Multiple numerical input - Sliders - Mandatory - 3 sliders from 1 to 100 - sum must equal 100
Q6 Long free text - Hidden - Appear if the third slider of Q5 is higher than 0 ((005_SQ004.NAOK > "0")) - Mandatory
Q7 Multiple numerical input - One slider between 1 and 100 - optional

Additional Information

I can provide a link to test the survey if needed

TagsNo tags attached.
Attached Files
screen.jpg (52,229 bytes)   
screen.jpg (52,229 bytes)   
Bug heat10
Complete LimeSurvey version number (& build)12204
I will donate to the project if issue is resolvedYes
BrowserFirefox and IE
Database type & versionMySQL 5.1.49-3
Server OS (if known)Debian 2.6.33.5
Webserver software & version (if known)Apache 2.0 Handler
PHP Version5.3.3-7+squeeze7 (protected with the Suhosin Patch 0.9.9.1)

Users monitoring this issue

peterhol

Activities

user15046

2012-02-14 10:46

  ~17393

I think I know why the issue is happening.
The issue comes from the default values.
When “Enable token-based response persistence?” is set to “Yes”
And “Allow editing answers after completion?” is set to “No”
Limesurvey tries to pick up the survey from the last active page when clicking on a personal link (with personal token). I may be mistaken but it seems that the default values are re-inserted in the fields with default value even if those values where previously edited by the user. Hence, because one of my question is mandatory and is using default value from the token db, when the value is blank in the token db, the conditions does not match!
The error does not happen when setting the option “Allow editing answers after completion?” to “Yes” because when clicking on a personal link (with personal token) Limesurvey start the survey back from the beginning.
So there is indeed a bug. The previously inserted answers should override default value and not the opposite!

Mazi

Mazi

2012-02-14 11:11

updater   ~17394

Please upload a sample survey which we can use to reproduce the problem.
Thanks!

user15046

2012-02-14 15:37

  ~17451

To reproduce the error quickly:
Activate the survey, activate the tokens, add a token with a Firstname but no Lastname.
Do half of the survey with the token (Answer the First group and click next). Close your browser then open the link (to be sure it's best to open it in another browser) to continue your survey: e.g. http//:your.server.com/limesurvey/index.php?sid=48545&lang=en&token=<Your_Token>

You should see the error: "Warning: Invalid argument supplied for foreach() in /home/dready/www/limesurvey/classes/eval/LimeExpressionManager.php on line 4668"

TMSWhite

TMSWhite

2012-02-17 22:24

reporter   ~17500

Fixed in revision https://github.com/LimeSurvey/LimeSurvey/commit/616222fa7e14dc345c69247b3447324bebdad55f

c_schmitz

c_schmitz

2012-02-26 14:21

administrator   ~17656

1.92RC5 release

Related Changesets

LimeSurvey: Yii d7a37c3b

2012-02-17 13:25:22

TMSWhite

Details Diff
Fixed issue 05819: Survey with token activated. When users go back on an uncompleted survey, they get an error and cannot continue. Affected Issues
05819
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/frontend_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-02-14 01:29 user15046 New Issue
2012-02-14 10:46 user15046 Note Added: 17393
2012-02-14 11:10 Mazi Assigned To => TMSWhite
2012-02-14 11:10 Mazi Status new => assigned
2012-02-14 11:11 Mazi Note Added: 17394
2012-02-14 11:11 Mazi Status assigned => feedback
2012-02-14 15:28 user15046 File Added: limesurvey_survey_48545.lss
2012-02-14 15:37 user15046 Note Added: 17451
2012-02-14 15:37 user15046 Status feedback => assigned
2012-02-14 15:40 user15046 File Added: screen.jpg
2012-02-16 11:16 peterhol Issue Monitored: peterhol
2012-02-17 18:44 TMSWhite Target Version => 1.92RC5
2012-02-17 22:24 TMSWhite Note Added: 17500
2012-02-17 22:24 TMSWhite Status assigned => resolved
2012-02-17 22:24 TMSWhite Fixed in Version => 1.92RC5
2012-02-17 22:24 TMSWhite Resolution open => fixed
2012-02-26 14:21 c_schmitz Note Added: 17656
2012-02-26 14:21 c_schmitz Status resolved => closed
2012-03-14 21:08 TMSWhite Changeset attached => Import 2012-03-09 13:30:34 Yii d7a37c3b
2021-08-04 18:37 guest Bug heat 8 => 10