- Posts: 46
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
CDbException
- jerryd
- Topic Author
- Offline
- Senior Member
Less
More
7 years 7 months ago #141938
by jerryd
Thanks alot
jerryd
CDbException was created by jerryd
hello every one i can't access the survey it shows me this error message how can i fix it?
The table "{{settings_global}}" for active record class "SettingGlobal" cannot be found in the database.
/home/form/framework/db/ar/CActiveRecord.php(2362)
2350
2351 /**
2352 * Constructor.
2353 * @param CActiveRecord $model the model instance
2354 * @throws CDbException if specified table for active record class cannot be found in the database
2355 */
2356 public function __construct($model)
2357 {
2358 $this->_modelClassName=get_class($model);
2359
2360 $tableName=$model->tableName();
2361 if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2362 throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2363 array('{class}'=>$this->_modelClassName,'{table}'=>$tableName)));
2364 if($table->primaryKey===null)
2365 {
2366 $table->primaryKey=$model->primaryKey();
2367 if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2368 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2369 elseif(is_array($table->primaryKey))
2370 {
2371 foreach($table->primaryKey as $name)
2372 {
2373 if(isset($table->columns[$name]))
2374 $table->columns[$name]->isPrimaryKey=true;
Stack Trace
#0
+ /home/form/framework/db/ar/CActiveRecord.php(411): CActiveRecordMetaData->__construct(SettingGlobal)
#1
+ /home/form/framework/db/ar/CActiveRecord.php(677): CActiveRecord->getMetaData()
#2
– /home/form/application/models/LSActiveRecord.php(28): CActiveRecord->hasAttribute("created")
23 * @see PluginEventBehavior
24 * @return array
25 */
26 public function behaviors(){
27 $aBehaviors=array();
28 $sCreateFieldName=($this->hasAttribute('created')?'created':null);
29 $sUpdateFieldName=($this->hasAttribute('modified')?'modified':null);
30 $sDriverName = Yii::app()->db->getDriverName();
31 if ($sDriverName=='sqlsrv' || $sDriverName=='dblib')
32 {
33 $sTimestampExpression=new CDbExpression('GETDATE()');
#3
+ /home/form/framework/db/ar/CActiveRecord.php(396): LSActiveRecord->behaviors()
#4
– /home/form/application/models/SettingGlobal.php(28): CActiveRecord::model("SettingGlobal")
23 * @param string $class
24 * @return CActiveRecord
25 */
26 public static function model($class = __CLASS__)
27 {
28 return parent::model($class);
29 }
30
31 /**
32 * Returns the setting's table name to be used by the model
33 *
#5
– /home/form/application/helpers/globalsettings_helper.php(21): SettingGlobal::model()
16 injectglobalsettings();
17
18
19 function injectglobalsettings()
20 {
21 $settings = SettingGlobal::model()->findAll();
22
23 //if ($dbvaluearray!==false)
24 if (count($settings) > 0)
25 {
26 //foreach ($dbvaluearray as $setting)
#6
+ /home/form/application/helpers/globalsettings_helper.php(16): injectglobalsettings()
#7
+ /home/form/framework/YiiBase.php(320): require("/home/form/application/helpers/globalsettings_helper.php")
#8
+ /home/form/application/core/LSYii_Application.php(96): YiiBase::import("application.helpers.globalsettings_helper", true)
#9
+ /home/form/application/core/LSYii_Controller.php(69): LSYii_Application->loadHelper("globalsettings")
#10
+ /home/form/application/core/LSYii_Controller.php(37): LSYii_Controller->loadHelper("globalsettings")
#11
+ /home/form/framework/web/CWebApplication.php(359): LSYii_Controller->__construct("surveys", null)
#12
+ /home/form/framework/web/CWebApplication.php(276): CWebApplication->createController("")
#13
+ /home/form/framework/web/CWebApplication.php(141): CWebApplication->runController("")
#14
+ /home/form/framework/base/CApplication.php(184): CWebApplication->processRequest()
#15
+ /home/form/index.php(211): CApplication->run()
2016-09-19 14:37:27 Apache/2.4.10 (Debian) Yii Framework/1.1.15
The table "{{settings_global}}" for active record class "SettingGlobal" cannot be found in the database.
/home/form/framework/db/ar/CActiveRecord.php(2362)
2350
2351 /**
2352 * Constructor.
2353 * @param CActiveRecord $model the model instance
2354 * @throws CDbException if specified table for active record class cannot be found in the database
2355 */
2356 public function __construct($model)
2357 {
2358 $this->_modelClassName=get_class($model);
2359
2360 $tableName=$model->tableName();
2361 if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2362 throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2363 array('{class}'=>$this->_modelClassName,'{table}'=>$tableName)));
2364 if($table->primaryKey===null)
2365 {
2366 $table->primaryKey=$model->primaryKey();
2367 if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2368 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2369 elseif(is_array($table->primaryKey))
2370 {
2371 foreach($table->primaryKey as $name)
2372 {
2373 if(isset($table->columns[$name]))
2374 $table->columns[$name]->isPrimaryKey=true;
Stack Trace
#0
+ /home/form/framework/db/ar/CActiveRecord.php(411): CActiveRecordMetaData->__construct(SettingGlobal)
#1
+ /home/form/framework/db/ar/CActiveRecord.php(677): CActiveRecord->getMetaData()
#2
– /home/form/application/models/LSActiveRecord.php(28): CActiveRecord->hasAttribute("created")
23 * @see PluginEventBehavior
24 * @return array
25 */
26 public function behaviors(){
27 $aBehaviors=array();
28 $sCreateFieldName=($this->hasAttribute('created')?'created':null);
29 $sUpdateFieldName=($this->hasAttribute('modified')?'modified':null);
30 $sDriverName = Yii::app()->db->getDriverName();
31 if ($sDriverName=='sqlsrv' || $sDriverName=='dblib')
32 {
33 $sTimestampExpression=new CDbExpression('GETDATE()');
#3
+ /home/form/framework/db/ar/CActiveRecord.php(396): LSActiveRecord->behaviors()
#4
– /home/form/application/models/SettingGlobal.php(28): CActiveRecord::model("SettingGlobal")
23 * @param string $class
24 * @return CActiveRecord
25 */
26 public static function model($class = __CLASS__)
27 {
28 return parent::model($class);
29 }
30
31 /**
32 * Returns the setting's table name to be used by the model
33 *
#5
– /home/form/application/helpers/globalsettings_helper.php(21): SettingGlobal::model()
16 injectglobalsettings();
17
18
19 function injectglobalsettings()
20 {
21 $settings = SettingGlobal::model()->findAll();
22
23 //if ($dbvaluearray!==false)
24 if (count($settings) > 0)
25 {
26 //foreach ($dbvaluearray as $setting)
#6
+ /home/form/application/helpers/globalsettings_helper.php(16): injectglobalsettings()
#7
+ /home/form/framework/YiiBase.php(320): require("/home/form/application/helpers/globalsettings_helper.php")
#8
+ /home/form/application/core/LSYii_Application.php(96): YiiBase::import("application.helpers.globalsettings_helper", true)
#9
+ /home/form/application/core/LSYii_Controller.php(69): LSYii_Application->loadHelper("globalsettings")
#10
+ /home/form/application/core/LSYii_Controller.php(37): LSYii_Controller->loadHelper("globalsettings")
#11
+ /home/form/framework/web/CWebApplication.php(359): LSYii_Controller->__construct("surveys", null)
#12
+ /home/form/framework/web/CWebApplication.php(276): CWebApplication->createController("")
#13
+ /home/form/framework/web/CWebApplication.php(141): CWebApplication->runController("")
#14
+ /home/form/framework/base/CApplication.php(184): CWebApplication->processRequest()
#15
+ /home/form/index.php(211): CApplication->run()
2016-09-19 14:37:27 Apache/2.4.10 (Debian) Yii Framework/1.1.15
Thanks alot
jerryd
The topic has been locked.
- LouisGac
- Visitor
7 years 7 months ago #141941
by LouisGac
Replied by LouisGac on topic CDbException
Hi,
which version of LimeSurvey are you using?
It seems that you don't have the table settings_global. Maybe you removed it manually?
which version of LimeSurvey are you using?
It seems that you don't have the table settings_global. Maybe you removed it manually?
The topic has been locked.
- jerryd
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 0
7 years 7 months ago #141943
by jerryd
Thanks alot
jerryd
Replied by jerryd on topic CDbException
tnx for your fast replay i didn't remove it manually but is their any option to fix this error manually?
Thanks alot
jerryd
The topic has been locked.
- LouisGac
- Visitor
7 years 7 months ago #141944
by LouisGac
Replied by LouisGac on topic CDbException
well I'd say that just adding that table again should solve the problem (if it's empty, it will filled automatically with default values at first login).
The topic has been locked.
- LouisGac
- Visitor
7 years 7 months ago #141945
by LouisGac
Replied by LouisGac on topic CDbException
so if your table prefix is lime, and you're using MySql:
But I can't guarantee the result, because you didn't tell us how this happened, what build you're using, etc.
Code:
CREATE TABLE IF NOT EXISTS `lime_settings_global` ( `stg_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `stg_value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', PRIMARY KEY (`stg_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
But I can't guarantee the result, because you didn't tell us how this happened, what build you're using, etc.
The topic has been locked.
- jerryd
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 0
7 years 6 months ago #141985
by jerryd
Thanks alot
jerryd
Replied by jerryd on topic CDbException
i am using (Version 2.06+ Build 151018) i can't get the reason why its have this kind of error because it was working fine for the last two days then when i tried to open the survey on the next day it shows me this kind of error.
Thanks alot
jerryd
The topic has been locked.
- jerryd
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 0
7 years 6 months ago #141987
by jerryd
Thanks alot
jerryd
Replied by jerryd on topic CDbException
the table lime_setting_global is already exist
Thanks alot
jerryd
The topic has been locked.
- LouisGac
- Visitor
7 years 6 months ago #141988
by LouisGac
Replied by LouisGac on topic CDbException
151018 is quiet an old version. You should have updated.
I can't tell what happen, but the error message:
says clearly that the table yourprefix_settings_global doesn't exist.
I can't tell what happen, but the error message:
The table "{{settings_global}}" for active record class "SettingGlobal" cannot be found in the database.
says clearly that the table yourprefix_settings_global doesn't exist.
The topic has been locked.
- jerryd
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 0
7 years 6 months ago #141989
by jerryd
Thanks alot
jerryd
Replied by jerryd on topic CDbException
i was drop the table then create it again but can't get any change still the same.
Thanks alot
jerryd
The topic has been locked.
- LouisGac
- Visitor
7 years 6 months ago #141992
by LouisGac
Replied by LouisGac on topic CDbException
can you do a screenshot of the error message please?
The topic has been locked.
- jerryd
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 0
- LouisGac
- Visitor
7 years 6 months ago #141994
by LouisGac
Replied by LouisGac on topic CDbException
well I'm going to repeat myself, but you don't have the table in your database.
check its prefix, its name, and that there is no typo mistake.
check its prefix, its name, and that there is no typo mistake.
The topic has been locked.