CDbException

Discussions, notes, articles about framework.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

CDbException

Postby ggpaphos » 13 Jul 2016, 16:28

Hi,
I recently migrated my website to a new server, everything is working except for the dashboard on the CMS.

From the entry level page, which is a sub domain: search.paphosfinder.com I get the following error:
==========================================================================================

CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'translation_en' doesn't have a default value. The SQL statement executed was: INSERT INTO ore_translate_message (status, category, message)
VALUES (:status, :category, :message)

/home/magicpap123/search.paphosfinder.com/framework/db/CDbCommand.php(357)

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

145 VALUES (:status, :category, :message)";
146 Yii::app()->db->createCommand($sql)
147 ->bindValue(':status', TranslateMessage::STATUS_ERROR_NO_TRANSLATE, PDO::PARAM_INT)
148 ->bindValue(':category', $category, PDO::PARAM_STR)
149 ->bindValue(':message', $message, PDO::PARAM_STR)
150 ->execute();
151 } elseif ($messageRow['status'] != TranslateMessage::STATUS_ERROR_NO_TRANSLATE) {
152 // Обновляем запись что message без перевода
153 $sql = "UPDATE {{translate_message}} SET status=".TranslateMessage::STATUS_ERROR_NO_TRANSLATE
154 ." WHERE id=".$messageRow['id'];
155 Yii::app()->db->createCommand($sql)->execute();

#1

/home/magicpap123/search.paphosfinder.com/protected/components/CustomEventHandler.php(8): TranslateMessage::missingTranslation("common", "It is essential that you are the owner of the property, we will ...")

03 class CustomEventHandler {
04 static function handleMissingTranslation($event) {
05 if( in_array($event->category, array('YiiDebug.yii-debug-toolbar', 'yii-debug-toolbar')) ){
06 return false;
07 }
08 TranslateMessage::missingTranslation($event->category, $event->message);
09 }
10 }

#2
unknown(0): CustomEventHandler::handleMissingTranslation(CMissingTranslationEvent)
#3
+
/home/magicpap123/search.paphosfinder.com/framework/base/CComponent.php(556): call_user_func(array("CustomEventHandler", "handleMissingTranslation"), CMissingTranslationEvent)
#4
+
/home/magicpap123/search.paphosfinder.com/framework/i18n/CMessageSource.php(125): CComponent->raiseEvent("onMissingTranslation", CMissingTranslationEvent)
#5

/home/magicpap123/search.paphosfinder.com/protected/components/DbMessageSource.php(78): CMessageSource->onMissingTranslation(CMissingTranslationEvent)

73 if(isset($this->_messages[$key][$message]['translation']) && $this->_messages[$key][$message]['translation']!=='')
74 return $this->_messages[$key][$message]['translation'];
75 elseif($this->hasEventHandler('onMissingTranslation') && (!isset($this->_messages[$key][$message]['status']) || $this->_messages[$key][$message]['status'] == 0))
76 {
77 $event=new CMissingTranslationEvent($this,$category,$message,$language);
78 $this->onMissingTranslation($event);
79 return $event->message;
80 }
81 else
82 return $message;
83 }

#6
+
/home/magicpap123/search.paphosfinder.com/framework/i18n/CMessageSource.php(85): DbMessageSource->translateMessage("common", "It is essential that you are the owner of the property, we will ...", "en")
#7
+
/home/magicpap123/search.paphosfinder.com/framework/YiiBase.php(578): CMessageSource->translate("common", "It is essential that you are the owner of the property, we will ...", null)
#8
+
/home/magicpap123/search.paphosfinder.com/protected/views/site/login.php(18): YiiBase::t("common", "It is essential that you are the owner of the property, we will ...")
#9
+
/home/magicpap123/search.paphosfinder.com/framework/web/CBaseController.php(126): require("/home/magicpap123/search.paphosfinder.com/protected/views/site/l...")
#10
+
/home/magicpap123/search.paphosfinder.com/framework/web/CBaseController.php(95): CBaseController->renderInternal("/home/magicpap123/search.paphosfinder.com/protected/views/site/l...", array("model" => LoginForm), true)
#11
+
/home/magicpap123/search.paphosfinder.com/framework/web/CController.php(869): CBaseController->renderFile("/home/magicpap123/search.paphosfinder.com/protected/views/site/l...", array("model" => LoginForm), true)
#12
+
/home/magicpap123/search.paphosfinder.com/framework/web/CController.php(782): CController->renderPartial("login", array("model" => LoginForm), true)
#13
+
/home/magicpap123/search.paphosfinder.com/protected/controllers/SiteController.php(184): CController->render("login", array("model" => LoginForm))
#14
+
/home/magicpap123/search.paphosfinder.com/framework/web/actions/CInlineAction.php(49): SiteController->actionLogin()
#15
+
/home/magicpap123/search.paphosfinder.com/framework/web/CController.php(308): CInlineAction->runWithParams(array())
#16
+
/home/magicpap123/search.paphosfinder.com/framework/web/CController.php(286): CController->runAction(CInlineAction)
#17
+
/home/magicpap123/search.paphosfinder.com/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#18
+
/home/magicpap123/search.paphosfinder.com/framework/web/CWebApplication.php(282): CController->run("login")
#19
+
/home/magicpap123/search.paphosfinder.com/framework/web/CWebApplication.php(141): CWebApplication->runController("site/login")
#20
+
/home/magicpap123/search.paphosfinder.com/framework/base/CApplication.php(169): CWebApplication->processRequest()
#21
+
/home/magicpap123/search.paphosfinder.com/index.php(20): CApplication->run()

========================================================================

I am going to update this to a newer version as soon as I finish the primary site.....

I need a fix for now before I upgrade and export the database to the new CMS, please help.
ggpaphos
Stranger
 
Posts: 1
Joined: 13 Jul 2016, 16:10
Reputation point: 0

Re: CDbException

Postby Foton » 14 Jul 2016, 11:21

Please check your MySQL server version
Foton
Web Developer
Web Developer
 
Posts: 117
Joined: 26 Jan 2012, 14:58
Reputation point: 1


Return to Yii framework

Who is online

Users browsing this forum: No registered users and 7 guests

cron