CDbException

CDbCommand n'a pas pu exécuter la commande SQL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3' for key 'PRIMARY'. The SQL statement executed was: INSERT INTO `lime_groups` (`sid`, `group_name`, `group_order`, `randomization_group`, `description`, `language`, `gid`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6)

/home/sondages.pro/htdocs/limesurvey_GIT/testing/develop/framework/db/CDbCommand.php(358)

346         {
347             if($this->_connection->enableProfiling)
348                 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');
349 
350             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
351             $message=$e->getMessage();
352             Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
353                 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
354 
355             if(YII_DEBUG)
356                 $message.='. The SQL statement executed was: '.$this->getText().$par;
357 
358             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
359                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
360         }
361     }
362 
363     /**
364      * Executes the SQL statement and returns query result.
365      * This method is for executing an SQL query that returns result set.
366      * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative
367      * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
368      * them in this way can improve the performance. Note that if you pass parameters in this way,
369      * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
370      * Please also note that all values are treated as strings in this case, if you need them to be handled as

Stack Trace

#2
+
 /home/sondages.pro/htdocs/limesurvey_GIT/testing/develop/application/models/QuestionGroup.php(143): CActiveRecord->save()
138     {
139         $group = new self;
140         foreach ($data as $k => $v){
141             $group->$k = $v;
142         }
143         if  (!$group->save()){
144             return false;
145         }
146         else {
147             return $group->gid;
148         }
#3
+
 /home/sondages.pro/htdocs/limesurvey_GIT/testing/develop/application/helpers/admin/import_helper.php(922): QuestionGroup->insertRecords(array("sid" => "657185", "group_name" => "Question de type texte", "group_order" => "0", "description" => "Ceci est la description du groupe de questions de type texte.", ...))
917             if (isset($aGIDReplacements[$oldgid])){
918                 switchMSSQLIdentityInsert('groups',true);
919                 $insertdata['gid']=$aGIDReplacements[$oldgid];
920             }
921 
922             $newgid = QuestionGroup::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data [3]<br />");
923             if (!isset($aGIDReplacements[$oldgid])){
924                 $aGIDReplacements[$oldgid]=$newgid; // add old and new qid to the mapping array
925                 $results['groups']++;
926             }else{
927                 switchMSSQLIdentityInsert('groups',false);
#4
+
 /home/sondages.pro/htdocs/limesurvey_GIT/testing/develop/application/helpers/admin/import_helper.php(658): XMLImportSurvey("/home/sondages.pro/htdocs/limesurvey_GIT/testing/develop/tmp/nsk...", null, null, null, ...)
653     }else{
654         $sExtension = "";
655     }
656 
657     if ($sExtension == 'lss'){
658         return XMLImportSurvey($sFullFilePath, null, $sNewSurveyName, $DestSurveyID, $bTranslateLinksFields);
659     }elseif ($sExtension == 'txt' || $sExtension == 'tsv'){
660         return TSVImportSurvey($sFullFilePath);
661     }elseif ($sExtension == 'lsa'){
662           // Import a survey archive
663         Yii::import("application.libraries.admin.pclzip.pclzip", true);
2017-10-31 12:12:22 Apache/2.2.22 (Debian) Yii Framework/1.1.18