Fehler #246
geschlossenUnterstützung #216: Browserinkompatibilitäten und Testen
Unterstützung #239: Formulare testen
Konfiguration
100%
Beschreibung
Rolle: Admin, Seite: Konfiguration, Aktion: speichern klicken
Wenn ich nichts ändere und auf "Speichern" klicke, kommt folgender Fehler:
CDbException
CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'child' already exists. The SQL statement executed was: CREATE TABLE `child` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL
) DEFAULT CHARSET=utf8
/home/est/public_html/est_trunk/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
#0
+
/home/est/public_html/est_trunk/framework/db/CDbCommand.php(1324): CDbCommand->execute()
#1
–
/home/est/public_html/est_trunk/protected/models/ConfigForm.php(147): CDbCommand->createTable("child", array("id" => "pk", "firstname" => "string NOT NULL", "lastname" => "string NOT NULL"), "DEFAULT CHARSET=utf8")
142
143 $command->createTable("child", array(
144 'id' => 'pk',
145 'firstname' => 'string NOT NULL',
146 'lastname' => 'string NOT NULL',
147 ), 'DEFAULT CHARSET=utf8');
148 $command->createTable("YiiSession", array(
149 'id' => 'string NOT NULL',
150 'expire' => 'integer',
151 'data' => 'longblob',
152 ), 'DEFAULT CHARSET=utf8');
#2
–
/home/est/public_html/est_trunk/protected/models/ConfigForm.php(291): ConfigForm->createTables(CDbCommand)
286 public function tables() {
287 $rc = true;
288 $connection = $this->getConnection();
289 if ($connection->active) {
290 $command = $connection->createCommand();
291 $this->createTables($command);
292 $this->addForeignKeys($command);
293 $this->createIndices($command);
294 $this->fillTable($command);
295 } else {
296 $this->addError('databaseHost', 'Die Datenbankverbindung konnte nicht hergestellt werden.');
#3
–
/home/est/public_html/est_trunk/protected/controllers/SiteController.php(89): ConfigForm->tables()
84 $createAdminUser = true;
85 }
86 $str = base64_encode(serialize($model->attributes));
87 file_put_contents($file, $str);
88 if ($createAdminUser) {
89 if ($model->tables()) {
90 $user = new User();
91 $user->setSomeAttributes($model->adminEmail, 'admin', 'admin', 1, 0);
92 $password = $user->generatePassword();
93 $user->password_repeat = $password;
94 $user->save();
#4
/home/est/public_html/est_trunk/framework/web/actions/CInlineAction.php(49): SiteController->actionConfig()
#5
/home/est/public_html/est_trunk/framework/web/CController.php(308): CInlineAction->runWithParams(array("r" => "site/config"))
#6
/home/est/public_html/est_trunk/framework/web/CController.php(286): CController->runAction(CInlineAction)
#7
/home/est/public_html/est_trunk/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#8
/home/est/public_html/est_trunk/framework/web/CWebApplication.php(282): CController->run("config")
#9
/home/est/public_html/est_trunk/framework/web/CWebApplication.php(141): CWebApplication->runController("site/config")
#10
/home/est/public_html/est_trunk/framework/base/CApplication.php(169): CWebApplication->processRequest()
#11
/home/est/public_html/est_trunk/index.php(30): CApplication->run()
Von Christian Ehringfeld vor mehr als 11 Jahren aktualisiert
- Status wurde von Neu zu Erledigt geändert
- % erledigt wurde von 0 zu 100 geändert
r592
Kommentar im Commit war falsch :/