Skip to content

Commit

Permalink
Fixed issue #7942: Error when copying questions with subquestions and…
Browse files Browse the repository at this point in the history
… using MSSQL
  • Loading branch information
c-schmitz committed Sep 19, 2013
1 parent f0acd31 commit 767b495
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/controllers/admin/database.php
Expand Up @@ -481,8 +481,10 @@ function index($sa = null)
unset($qr1['qid']);
}
$qr1['gid'] = $postgid;
if (isset($qr1['qid'])) switchMSSQLIdentityInsert('questions',true);
$iInsertID = Questions::model()->insertRecords($qr1);
if (!isset($qr1['qid']))
if (isset($qr1['qid'])) switchMSSQLIdentityInsert('questions',false);
else
{
$aSQIDMappings[$oldqid] = $iInsertID;
}
Expand Down

0 comments on commit 767b495

Please sign in to comment.