View Issue Details

This bug affects 1 person(s).
 20
IDProjectCategoryView StatusLast Update
10162Bug reportsSurvey takingpublic2018-11-15 15:13
ReportergeraldC Assigned Todominikvitt 
PriorityurgentSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.06+ 
Fixed in Version3.15.x 
Summary10162: new visit on a survey with token deletes last entry
Description

When a participant with a token visits for the second time a survey (or on any subsequent visit) using the link received in the invitation email, the last response of this survey is deleted from the db, even if he or she doesn't visit the last page of the survey.

Steps To Reproduce
  1. Create a survey with some pages
  2. Generate a token
  3. Visit the survey with the link provided in the invitation email
  4. Submit the survey
  5. Visit the same survey with the same link (provided in the invitation email)
  6. Even without the participant submitting the survey again, the last response in the db is deleted.

See the .lsa attached for an example of survey.

Additional Information

Survey parameters :

  • Anonymized responses? No
  • Allow multiple responses or update responses with one token? Yes
  • Enable token-based response persistence? : Yes

Note : If the participant had added into the url the parameter "newtest", as it is proposed by LS in the admin interface :

TagsNo tags attached.
Attached Files
Bug heat20
Complete LimeSurvey version number (& build)Build 151018
I will donate to the project if issue is resolvedNo
Browserany
Database type & versionMySQL client version: mysqlnd 5.0.11
Server OS (if known)Server version: 5.5.44-0+deb7u1
Webserver software & version (if known)Apache/2.2.22 (Debian)
PHP Version5.4.41

Users monitoring this issue

DenisChenu, duvemyster

Activities

DenisChenu

DenisChenu

2015-12-17 14:47

developer   ~34047

Build 151018 : it's not the last build. Can you update to last build ?

limesurvey206plus-build151215.zip
https://www.limesurvey.org/en/downloads/category/25-latest-stable-release

Forum post : https://www.limesurvey.org/en/forum/french-forum/103143-bug-survey-avec-token-supprime-les-derni%C3%A8res-r%C3%A9ponses-lorsque-visit%C3%A9-%C3%A0-nouveau

geraldC

geraldC

2015-12-17 15:20

reporter   ~34048

Sure. Done. The new build is 151215. The "bug" is still here (see second attached file).

DenisChenu

DenisChenu

2015-12-18 09:03

developer   ~34053

Hi,
Yes, can reproduce the issue ...

Starting with newtest=Y : OK last group still YES (or NO)
Starting without newtest=Y (without close browser): last group become "No answer".

ollehar

ollehar

2015-12-21 18:00

administrator   ~34076

I cannot reproduce this. What I did:

  1. Create new survey with one question
  2. Set options as described above
  3. Generate tokens
  4. Send e-mail
  5. Click on link in e-mail and submit survey
  6. Answer is in database table lime_survey_44857
  7. Click again on link in e-mail
  8. Answer is still in database table
DenisChenu

DenisChenu

2015-12-21 18:38

developer   ~34078

Think you need, at minima 2 group. Tested with included lss file.

ollehar

ollehar

2016-01-04 11:56

administrator   ~34128

OK, I've been able to reproduce both with imported survey and with my own survey. Will fix.

ollehar

ollehar

2016-01-04 14:06

administrator   ~34129

Last edited: 2016-01-04 15:08

For my own info, this problem does NOT occur if you clear the cookies before re-clicking on the link in the e-mail. The last question group is stored in the cookie as $LEM->currentQset, file em_manager_helper.php (function ProcessCurrentResponses).

Solution 1: Deleting NavigateForwards() on line 270 (?) in file SurveyRuntimeHelper.php? (There's another bug where $seq == -1 even if welcome page is set to No.)

Solution 2: Never save NULL values to database (but does NULL represent "No answer"?)

Solution 3: Make sure no saves are done when clicking on the mail link. NavigateForwards() should be separated from saving in that case.

Solution 4: Clear cookie after survey submit.

ollehar

ollehar

2016-01-04 15:29

administrator   ~34130

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

ollehar

ollehar

2016-01-04 15:31

administrator   ~34131

Fixed by changing NavigateForward to JumpTo in SurveyRuntimeHelper.php, lines 268-272. Will this break anything else?

DenisChenu

DenisChenu

2016-01-04 15:34

developer   ~34132

Yep : NavigateForwards is a bad idea, we jump, we don't navigate :)

c_schmitz

c_schmitz

2016-01-22 09:44

administrator   ~34342

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

c_schmitz

c_schmitz

2016-01-22 09:51

administrator   ~34343

I had to revert that patch because it caused the second question to be skipped if the first one was hidden. You will need to take another look at it.

DenisChenu

DenisChenu

2016-01-22 10:37

developer   ~34345

Carsten : a little lss file ? ;).

It's for Q by Q survey ?

ollehar

ollehar

2016-02-04 16:26

administrator   ~34573

Second solution could be to correctly clear the session after survey submission. Dump $_POST and $_SESSION to inspect. OR: Clear session at survey start. OR: Clear session before navigating forward.

fepifani

fepifani

2018-04-25 12:19

reporter   ~47518

This bug is still present even in last release (v.3.7.1, build 180424).
Is there some forecast about a fix?
I can't ask partecipants to clear cookies after a submission.
Is there some workaround I can use?
Thank you

ollehar

ollehar

2018-05-16 12:59

administrator   ~47632

Tuff one. I might have time to look at this again the coming week.

Mazi

Mazi

2018-10-01 14:50

updater   ~49202

@olle, is this still an issue at the latest 3.1x version?

ollehar

ollehar

2018-10-01 14:59

administrator   ~49204

@Mazi, AFAIK, yes.

dominikvitt

dominikvitt

2018-10-18 14:03

developer   ~49358

Unable to reproduce this issue using the latest version 3.15.1, it may be already fixed.

dominikvitt

dominikvitt

2018-10-18 14:09

developer   ~49359

I am able to reproduce this issue after all, would try to fix it.

guest

guest

2018-10-22 21:28

viewer   ~49409

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

Related Changesets

LimeSurvey: master 2460c694

2016-01-04 14:29:18

ollehar

Details Diff
Fixed issue 10162: Jump instead of navigate to avoid saving NULL-values for old question group cookie left-over Affected Issues
10162
mod - application/controllers/survey/index.php Diff File
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File

LimeSurvey: master 4fb2c859

2016-01-22 08:43:35

c_schmitz

Details Diff
Fixed issue 10162: Jump instead of navigate to avoid saving NULL-values for old question group cookie left-over (reverted from commit 2460c6945576e8f5843bc1f3e7137d2df45f9023) Affected Issues
10162
mod - application/controllers/survey/index.php Diff File
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File

LimeSurvey: master 2461a56d

2018-10-22 17:54:54

Dominik Vitt

Details Diff
Fixed issue 10162: new visit on a survey with token deletes last entry Affected Issues
10162
mod - application/helpers/frontend_helper.php Diff File

Issue History

Date Modified Username Field Change
2015-12-17 10:18 geraldC New Issue
2015-12-17 10:18 geraldC File Added: survey_archive_818769.lsa
2015-12-17 14:47 DenisChenu Note Added: 34047
2015-12-17 15:18 geraldC File Added: survey_archive_818769(1).lsa
2015-12-17 15:20 geraldC Note Added: 34048
2015-12-17 15:42 geraldC Issue Monitored: geraldC
2015-12-18 09:03 DenisChenu Note Added: 34053
2015-12-21 16:54 ollehar Assigned To => ollehar
2015-12-21 16:54 ollehar Status new => assigned
2015-12-21 18:00 ollehar Note Added: 34076
2015-12-21 18:38 DenisChenu Note Added: 34078
2016-01-04 11:56 ollehar Note Added: 34128
2016-01-04 14:06 ollehar Note Added: 34129
2016-01-04 14:06 ollehar Note Edited: 34129
2016-01-04 14:17 ollehar Note Edited: 34129
2016-01-04 14:17 ollehar Note Edited: 34129
2016-01-04 14:20 ollehar Note Edited: 34129
2016-01-04 14:39 ollehar Note Edited: 34129
2016-01-04 14:40 ollehar Note Edited: 34129
2016-01-04 14:52 ollehar Note Edited: 34129
2016-01-04 14:53 ollehar Note Edited: 34129
2016-01-04 15:08 ollehar Note Edited: 34129
2016-01-04 15:29 ollehar Changeset attached => LimeSurvey master 2460c694
2016-01-04 15:29 ollehar Note Added: 34130
2016-01-04 15:29 ollehar Resolution open => fixed
2016-01-04 15:31 ollehar Note Added: 34131
2016-01-04 15:31 ollehar Assigned To ollehar => c_schmitz
2016-01-04 15:31 ollehar Status assigned => feedback
2016-01-04 15:34 DenisChenu Note Added: 34132
2016-01-22 09:44 c_schmitz Changeset attached => LimeSurvey master 4fb2c859
2016-01-22 09:44 c_schmitz Note Added: 34342
2016-01-22 09:51 c_schmitz Note Added: 34343
2016-01-22 09:51 c_schmitz Assigned To c_schmitz => ollehar
2016-01-22 09:51 c_schmitz Status feedback => assigned
2016-01-22 10:37 DenisChenu Note Added: 34345
2016-02-04 16:26 ollehar Note Added: 34573
2016-02-04 17:10 ollehar Status assigned => acknowledged
2016-08-25 12:29 c_schmitz Priority normal => urgent
2016-08-29 12:55 ollehar Sticky Issue No => Yes
2016-08-29 12:55 ollehar Sticky Issue Yes => No
2018-04-25 12:19 fepifani Note Added: 47518
2018-04-27 17:34 duvemyster Issue Monitored: duvemyster
2018-05-16 12:59 ollehar Note Added: 47632
2018-09-24 17:32 geraldC Issue End Monitor: geraldC
2018-10-01 14:50 Mazi Note Added: 49202
2018-10-01 14:59 ollehar Note Added: 49204
2018-10-08 11:05 ollehar Assigned To ollehar =>
2018-10-16 00:13 DenisChenu Issue Monitored: DenisChenu
2018-10-18 09:49 c_schmitz Severity minor => partial_block
2018-10-18 09:49 c_schmitz Assigned To => dominikvitt
2018-10-18 09:49 c_schmitz Status acknowledged => assigned
2018-10-18 14:03 dominikvitt Status assigned => resolved
2018-10-18 14:03 dominikvitt Resolution fixed => unable to reproduce
2018-10-18 14:03 dominikvitt Note Added: 49358
2018-10-18 14:09 dominikvitt Status resolved => assigned
2018-10-18 14:09 dominikvitt Note Added: 49359
2018-10-22 21:28 Changeset attached => LimeSurvey master 2461a56d
2018-10-22 21:28 guest Note Added: 49409
2018-10-22 21:28 guest Resolution unable to reproduce => fixed
2018-10-23 10:53 dominikvitt Status assigned => resolved
2018-10-23 10:53 dominikvitt Fixed in Version => 3.15.x
2018-11-15 15:13 dominikvitt Status resolved => closed
2021-08-02 20:16 guest Bug heat 16 => 20