Skip to content

Commit

Permalink
Fixed issue #4663: SQL error when copying/importing a survey with sub…
Browse files Browse the repository at this point in the history
…questions on MSSQL

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9195 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 8, 2010
1 parent 5a3fcb4 commit 5b949fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions admin/importsurvey.php
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL)
$insertdata['help']=translink('survey', $oldsid, $newsid, $insertdata['help']);
if (isset($aQIDReplacements[$oldsqid])){
$insertdata['qid']=$aQIDReplacements[$oldsqid];
db_switchIDInsert('questions',true);
}

$query=$connect->GetInsertSQL($tablename,$insertdata);
Expand All @@ -1427,6 +1428,10 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL)
{
$aQIDReplacements[$oldsqid]=$newsqid; // add old and new qid to the mapping array
}
else
{
db_switchIDInsert('questions',false);
}
$results['subquestions']++;
}
}
Expand Down

0 comments on commit 5b949fe

Please sign in to comment.