Skip to content

Commit

Permalink
Fixed issue #4861: .csv structure file fails to import if question co…
Browse files Browse the repository at this point in the history
…ntains invalid label set ID

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9686 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jan 14, 2011
1 parent 5069a5b commit 8bb7ecd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/import_functions.php
Expand Up @@ -35,6 +35,7 @@ function CSVImportSurvey($sFullFilepath,$iDesiredSurveyId=NULL)

$aIgnoredAnswers=array();
$aSQIDReplacements=array();
$aLIDReplacements=array();
$aGIDReplacements=array();
$substitutions=array();
$aQuotaReplacements=array();
Expand Down Expand Up @@ -721,7 +722,7 @@ function CSVImportSurvey($sFullFilepath,$iDesiredSurveyId=NULL)


// Now we will fix up old label sets where they are used as answers
if ((isset($oldlid1) || isset($oldlid2)) && ($qtypes[$questionrowdata['type']]['answerscales']>0 || $qtypes[$questionrowdata['type']]['subquestions']>1))
if (((isset($oldlid1) && isset($aLIDReplacements[$oldlid1])) || (isset($oldlid2) && isset($aLIDReplacements[$oldlid2]))) && ($qtypes[$questionrowdata['type']]['answerscales']>0 || $qtypes[$questionrowdata['type']]['subquestions']>1))
{
$query="select * from ".db_table_name('labels')." where lid={$aLIDReplacements[$oldlid1]} and language='{$questionrowdata['language']}'";
$oldlabelsresult=db_execute_assoc($query);
Expand Down

0 comments on commit 8bb7ecd

Please sign in to comment.