CDbException

CDbCommand n'a pas pu exécuter la commande SQL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY'. The SQL statement executed was: INSERT INTO `lime_tokens_842538` (`sent`, `remindersent`, `remindercount`, `completed`, `usesleft`, `tid`, `participant_id`, `firstname`, `lastname`, `language`, `mpid`, `validfrom`, `email`, `token`, `emailstatus`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14)

/var/www/limesurvey.2i2l.net/www/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

#1
+
 /var/www/limesurvey.2i2l.net/www/framework/db/ar/CActiveRecord.php(811): CActiveRecord->insert(null)
806      * @return boolean whether the saving succeeds
807      */
808     public function save($runValidation=true,$attributes=null)
809     {
810         if(!$runValidation || $this->validate($attributes))
811             return $this->getIsNewRecord() ? $this->insert($attributes) : $this->update($attributes);
812         else
813             return false;
814     }
815 
816     /**
#2
+
 /var/www/limesurvey.2i2l.net/www/plugins/surveyChaining/surveyChaining.php(727): CActiveRecord->save()
722         $language = App()->getLanguage();
723         if(!in_array($language,Survey::model()->findByPk($nextSurvey)->getAllLanguages())) {
724             $language = Survey::model()->findByPk($nextSurvey)->language;
725         }
726         $oToken->language = $language;
727         if(!$oToken->save()) {
728             $this->log($this->gT("Unable to create token for $nextSurvey"),\CLogger::LEVEL_ERROR);
729             return null;
730         }
731         return $oToken;
732     }
#3
+
 /var/www/limesurvey.2i2l.net/www/plugins/surveyChaining/surveyChaining.php(478): surveyChaining->_createToken("842538", "denis@sondages.pro", array("tid" => "2", "participant_id" => null, "firstname" => "", "lastname" => "", ...))
473                         unset($aAttributes['usesleft']);
474                         unset($aAttributes['validfrom']);
475                         unset($aAttributes['validuntil']);
476                     }
477                 }
478                 $oToken = $this->_createToken($nextSurvey,$sEmail,$aAttributes);
479             }
480         }
481         /* Create response */
482         if (!$oResponse) {
483             $oResponse = Response::create($nextSurvey);
#4
 unknown(0): surveyChaining->afterSurveyComplete()
#5
+
 /var/www/limesurvey.2i2l.net/www/application/libraries/PluginManager/PluginManager.php(185): call_user_func(array(surveyChaining, "afterSurveyComplete"))
180         if (isset($this->subscriptions[$eventName])) {
181             foreach ($this->subscriptions[$eventName] as $subscription) {
182                 if (!$event->isStopped()
183                  && (empty($target) || in_array(get_class($subscription[0]), $target))) {
184                     $subscription[0]->setEvent($event);
185                     call_user_func($subscription);
186                 }
187             }
188         }
189 
190         return $event;
2020-01-09 16:59:45 Apache Yii Framework/1.1.21