View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
06943Bug reportsSurvey participants (Tokens)public2012-12-04 13:16
Reporterrom Assigned Tomdekker  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary06943: Restoring a Token Table of an pre 2.x Survey results in MySQL Error
Description

Restoring a Token Table of an deactivated survey which has been created before the 2.00+ Update results in an empty token table.

Steps To Reproduce

We had multiple EXPIRED Surveys in Limesurvey v1.91+ Build 10746. Each of these Surveys had a Token Table with 7 additional Attribute Fields.

We just upgraded to v2.00+ Build 121121 in a Test Environment. Once we deactivate one of our expired Surveys, we get the usual warning message, that the tokens table has been renamed to {{old_tokens_45688_20121123122124}}

Once we try to restore the token table (Survey = still deactivated) by clicking on the Token Management Button we SOMETIMES get an SQL Error Message:

Internal Server Error
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'participant_id' in 'field list'
An internal error occurred while the Web server was processing your request. Please contact the webmaster to report this problem.
Thank you.

Sometimes we do not get this error message, but in both cases we experience the following issue: The token summary displays the correct Record Count of Tokens, but once we click on the "Display tokens" button we see an empty table - no tokens/participants listed.

This problem is not reproducible with a survey/token table which we create with v2.00, it only occurs with our "old" token tables.

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)121121
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL v5
Server OS (if known)Linux
Webserver software & version (if known)Apache
PHP Version5.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2012-11-23 15:12

administrator   ~22445

In general we do not support the restoration of old survey or token tables from previous versions. They are completely unlinked from the system and in general are not updated.

rom

rom

2012-11-23 15:20

reporter   ~22450

Ich verstehe das dies auf alte Survey/Token-Tabellen zutrifft welche zum Zeitpunkt des Updates 1.90->2.00 bereits deaktiviert waren (old_tokens_xxxx).

Die hier angesprochenen Surveys/Tokens waren aber noch AKTIV, die Umfragen sind lediglich ausgelaufen (expired). Sollte in dem Fall bei einem Update nicht die Token Tabelle auf den neusten Stand angehoben werden?

mdekker

mdekker

2012-11-23 16:55

reporter   ~22451

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

mdekker

mdekker

2012-11-23 16:56

reporter   ~22452

@rom: you can try to replace your tokens.php with the one from the changeset or edit the file manually.

please report back if this fixed your problem

mdekker

mdekker

2012-11-23 16:58

reporter   ~22453

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

mdekker

mdekker

2012-11-23 17:21

reporter   ~22458

Feel free to reopen if the problem still exists after this fix

rom

rom

2012-11-23 17:27

reporter   ~22460

Last edited: 2012-11-23 17:29

@mdekker: I replaced the tokens and the survey_links file, and did not get the SQL Error again. (4 tries)

But still getting the same result as before: The tokens table is empty afterwards. I attached a video file for better explanation. Also, please note: That error DOES NOT occur if I manually delete every token (since you guys removed the "empty token table" option) and replace them with dummy entries.

The entries in the video are not dummy entries, they are the old ones. I just replaced the real names with a "test" string.

mdekker

mdekker

2012-11-24 11:19

reporter   ~22478

it looks like the tokens are there, but not showing because of some illegal join condition. I will check on that. In the meantime, can you verify for me that in the table the records are present using a tool like phpmyadmin or similar?

mdekker

mdekker

2012-11-24 11:55

reporter   ~22479

I tried again but am not able to reproduce when i delete the extra fields from the token table i can get the sql error you had but that is fixed now and the missing fields are created. Following that I always see the right numbers and the tokens.

Maybe something else has changed that fixed this from happening. There has been one other commit to the tokens.php file.
Could you download the lastest tokens.php and replace it?

rom

rom

2012-11-26 14:53

reporter   ~22541

I updated my tokens.php file to the one from 24.11.2012

Still the same issue. Checked with phpmyadmin, and the table is there, and has content.

But I finally got it: I digged through the content of the token tables as the problem did not occur with dummy entries, and just figured out the differences between the dummy entries and my old ones.

Once I set the "completed" field from a single entry to a date - e.g. "2011-11-01 10:20" instead of "N", the whole table is not displayed in the backend. I guess this will help you a lot.

mdekker

mdekker

2012-11-26 19:34

reporter   ~22549

Thanks, will have a look later! Are the fields in the old table empty or NULL?

rom

rom

2012-11-27 11:17

reporter   ~22602

No, the old table also is set to a Timestamp like "2011-11-01 10:20" in the completed column. Maybe the Token Management uses some other SQL commands to display the Token Table once the survey is deactivated as opposed to when it is activated or expired.

That could even make a bit of sense from a specific point of view, as a deactivated suvey may not contain tokens with a completed status, instead it should only contain incomplete tokens.

mdekker

mdekker

2012-11-27 13:34

reporter   ~22603

Your survey is deactivated... got that after reading a thousand times and breaking my head why it works for me ;-) I'm fixing it right now. Thank you for being precise and persistent, finally we got it! Will commit the fix soon.

rom

rom

2012-11-27 13:42

reporter   ~22604

Thanks for fixing it (& the warm words ;))

mdekker

mdekker

2012-11-27 13:42

reporter   ~22605

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

mdekker

mdekker

2012-11-28 13:59

reporter   ~22620

Feel free to reopen if the issue still exists. (is not in release 121127)

c_schmitz

c_schmitz

2012-12-04 13:16

administrator   ~22876

LimeSurvey 2.0+ build 121204 released.

Related Changesets

LimeSurvey: master 8f924023

2012-11-23 16:54

mdekker


Details Diff
Fixed 06943: Restoring a Token Table of an pre 2.x Survey results in MySQL Error Affected Issues
06943
mod - application/controllers/admin/tokens.php Diff File
mod - application/models/Survey_links.php Diff File

LimeSurvey: 2.1 d120ff10

2012-11-23 16:58

mdekker


Details Diff
Fixed 06943: Restoring a Token Table of an pre 2.x Survey results in MySQL Error Affected Issues
06943
mod - application/controllers/admin/tokens.php Diff File
mod - application/models/Survey_links.php Diff File

LimeSurvey: master 54a8af98

2012-11-24 11:43

mdekker


Details Diff
dev: cosmetic changes (include prefix in table name display) Affected Issues
06943
mod - application/controllers/admin/tokens.php Diff File

LimeSurvey: master bb915051

2012-11-27 13:42

mdekker


Details Diff
Fixed 06943: Restoring a Token Table of an pre 2.x Survey results in MySQL Error
dev: real change is only check for related record when survey is active, other is cleanup / optimization
Affected Issues
06943
mod - application/controllers/admin/tokens.php Diff File

Issue History

Date Modified Username Field Change
2012-11-23 12:35 rom New Issue
2012-11-23 15:09 c_schmitz Assigned To => c_schmitz
2012-11-23 15:09 c_schmitz Status new => assigned
2012-11-23 15:12 c_schmitz Note Added: 22445
2012-11-23 15:12 c_schmitz Status assigned => closed
2012-11-23 15:12 c_schmitz Resolution open => won't fix
2012-11-23 15:20 rom Note Added: 22450
2012-11-23 15:20 rom Status closed => feedback
2012-11-23 15:20 rom Resolution won't fix => reopened
2012-11-23 16:46 mdekker Assigned To c_schmitz => mdekker
2012-11-23 16:46 mdekker Status feedback => assigned
2012-11-23 16:55 mdekker Changeset attached => LimeSurvey master 8f924023
2012-11-23 16:55 mdekker Note Added: 22451
2012-11-23 16:56 mdekker Note Added: 22452
2012-11-23 16:58 mdekker Changeset attached => LimeSurvey 2.1 d120ff10
2012-11-23 16:58 mdekker Note Added: 22453
2012-11-23 17:21 mdekker Note Added: 22458
2012-11-23 17:21 mdekker Status assigned => resolved
2012-11-23 17:21 mdekker Fixed in Version => 2.00+
2012-11-23 17:21 mdekker Resolution reopened => fixed
2012-11-23 17:23 rom File Added: 2012-11-23 17h20_43.mp4
2012-11-23 17:27 rom Note Added: 22460
2012-11-23 17:27 rom Status resolved => feedback
2012-11-23 17:27 rom Resolution fixed => reopened
2012-11-23 17:29 rom Note Edited: 22460
2012-11-24 11:19 mdekker Note Added: 22478
2012-11-24 11:54 mdekker Changeset attached => LimeSurvey master 54a8af98
2012-11-24 11:55 mdekker Note Added: 22479
2012-11-26 14:53 rom Note Added: 22541
2012-11-26 14:53 rom Status feedback => assigned
2012-11-26 19:34 mdekker Note Added: 22549
2012-11-27 11:17 rom Note Added: 22602
2012-11-27 13:34 mdekker Note Added: 22603
2012-11-27 13:42 rom Note Added: 22604
2012-11-27 13:42 mdekker Changeset attached => LimeSurvey master bb915051
2012-11-27 13:42 mdekker Note Added: 22605
2012-11-28 13:59 mdekker Note Added: 22620
2012-11-28 13:59 mdekker Status assigned => resolved
2012-11-28 13:59 mdekker Resolution reopened => fixed
2012-12-04 13:16 c_schmitz Note Added: 22876
2012-12-04 13:16 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)