View Issue Details

IDProjectCategoryView StatusLast Update
03798Bug reports[All Projects] Conditionspublic2009-11-13 16:40
ReporterMaziAssigned Tolemeur 
Status closedResolutionfixed 
Product Version1.86 
Target VersionFixed in Version1.87RC1 
Summary03798: Conditions not shown after survey was imported
DescriptionWhen importing a survey which contains 90 conditions these conditions are not imported correctly. After import there is a message stating 90 conditions were imported but when taking a look at the question (last group of the survey) none of these are shown at the condition overview.
They exist in the database but are not shown at the backend.

I didn't test if they work although they are not listed att he backend.
TagsNo tags attached.
Complete LimeSurvey version number (& build)7777
I will donate to the project if issue is resolved
Database & DB-VersionMySQL 5
Operating System (Server)Win XP Sp 3
Webserver software & versionApache 2.2
PHP Version5.2


2009-10-28 12:29


limesurvey_survey_82532.csv (54,742 bytes)


2009-10-28 13:15


@ Mazi: can you reproduce the problem on the latest branch for v1.87RC1 too?


2009-10-28 13:46

developer   ~09889

yes, the problem still exists. Can't you reproduce the error?

Maybe the problem is caused by the fact that these conditions are based on tokens but the tokens don't exist after import?
But even when setting up tokens and creating the additional column which value is checked by conditions the problem still remains, no conditions are shown at condition overview.


2009-10-28 16:36


@ Mazi & Lemeur:
1. I can reproduce the issue.

@ Lemeur:
2. Instead of the conditions I get the following notices, if I run the attached survey after import:
Notice: Undefined variable: aAllConditions in /home/.sites/962/site989/web/limesurvey/qanda.php on line 101

Warning: Invalid argument supplied for foreach() in /home/.sites/962/site989/web/limesurvey/qanda.php on line 101

Notice: Undefined variable: conditions in /home/.sites/962/site989/web/limesurvey/qanda.php on line 119

3. Can you improve the dialog after importing a survey structure to display, which conditions failed because the tokens weren't available?

@ Mazi:
4. Can you provide a simple sample survey in english for Lemeur - for testing and bugfixing?

2009-10-28 16:59


bug_3798.csv (4,830 bytes)

2009-10-28 16:59


bug_3798_tokens_68893.csv (224 bytes)


2009-10-28 17:00

developer   ~09897

Files attached.


2009-10-28 17:52

developer   ~09899

I've juste figured out this bug in an important survey currently in producation at work :(

Import seems to be broken in such a way it replaces the {TOKEN:XXX} cfieldname in the condition table by soemthing else.

Will have a look at this soon.



2009-10-28 18:16

developer   ~09903

Another thing to test:
* are conditions based on SINGLE checkbox answers are correctly imported.


2009-10-28 21:11

developer   ~09907

Fixed in rev 7788.


2009-10-28 22:54

developer   ~09909

Last edited: 2009-10-28 22:55

Thibault, is there a way to "restore" the conditions of the imported survey? (Part of) the conditions are in the database, maybe there are just some parameters missing which can be added with an SQL UPDATE statement? Or is this a bigger problem?
According to rev. 7788: For this bug do I just have to replace 1 line at importsurvey.php if I want to update a 1.86 installation?!?



2009-10-29 08:54

developer   ~09913


There is no way to restore the conditions using the GUI, you have to edit the conditions with SQL UPDATE queries:
get the qid of the conditionnal questions that fail, then select the conditions for these questions:
SELECT from lime_conditions where qid=XXX

then get the cid of the corresponding conditions.

Update the cfieldname of each of these cid with the correct value {TOKEN:XXXX}

==> I have no other solution.

If you still have the CSV structure of your survey, the best is to apply the fix (1 extra line in importsurvey):
+ $newcfieldname=$oldcfieldname;

An then import again the survey.

Issue History

Date Modified Username Field Change
2009-10-28 12:29 Mazi New Issue
2009-10-28 12:29 Mazi Status new => assigned
2009-10-28 12:29 Mazi Assigned To => user372
2009-10-28 12:29 Mazi File Added: limesurvey_survey_82532.csv
2009-10-28 12:29 Mazi LimeSurvey build number => 7777
2009-10-28 12:29 Mazi Browser => FF3
2009-10-28 12:29 Mazi Database & DB-Version => MySQL 5
2009-10-28 12:29 Mazi Operating System (Server) => Win XP Sp 3
2009-10-28 12:29 Mazi Webserver => Apache 2.2
2009-10-28 12:29 Mazi PHP Version => 5.2
2009-10-28 13:15 user372 Note Added: 09888
2009-10-28 13:15 user372 Status assigned => feedback
2009-10-28 13:46 Mazi Note Added: 09889
2009-10-28 16:30 Mazi Status feedback => assigned
2009-10-28 16:36 user372 Note Added: 09895
2009-10-28 16:36 user372 Assigned To user372 => lemeur
2009-10-28 16:59 Mazi File Added: bug_3798.csv
2009-10-28 16:59 Mazi File Added: bug_3798_tokens_68893.csv
2009-10-28 17:00 Mazi Note Added: 09897
2009-10-28 17:52 lemeur Note Added: 09899
2009-10-28 17:52 lemeur Status assigned => acknowledged
2009-10-28 18:16 lemeur Note Added: 09903
2009-10-28 21:11 lemeur Note Added: 09907
2009-10-28 21:11 lemeur Status acknowledged => resolved
2009-10-28 21:11 lemeur Fixed in Version => 1.87RC1
2009-10-28 21:11 lemeur Resolution open => fixed
2009-10-28 22:54 Mazi Note Added: 09909
2009-10-28 22:55 Mazi Note Edited: 09909
2009-10-29 08:54 lemeur Note Added: 09913
2009-11-13 16:40 c_schmitz Status resolved => closed