CException

Общие вопросы по использованию фреймворка. Если не знаете как что-то сделать и это про Yii, вам сюда.
Ответить
KiriX
Сообщения: 1
Зарегистрирован: 2018.11.16, 23:21

CException

Сообщение KiriX » 2018.11.16, 23:26

Подключил сайт к базе, вроде все заработало, но когда захожу в админку, выдает ошибку CException

Не определено свойство "Content.text".

/var/www/user118605/data/www/s118605.smrtp.ru/framework/db/ar/CActiveRecord.php(144)

132 */
133 public function __get($name)
134 {
135 if(isset($this->_attributes[$name]))
136 return $this->_attributes[$name];
137 else if(isset($this->getMetaData()->columns[$name]))
138 return null;
139 else if(isset($this->_related[$name]))
140 return $this->_related[$name];
141 else if(isset($this->getMetaData()->relations[$name]))
142 return $this->getRelated($name);
143 else
144 return parent::__get($name);
145 }
146
147 /**
148 * PHP setter magic method.
149 * This method is overridden so that AR attributes can be accessed like properties.
150 * @param string $name property name
151 * @param mixed $value property value
152 */
153 public function __set($name,$value)
154 {
155 if($this->setAttribute($name,$value)===false)
156 {
Stack Trace
#0
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/db/ar/CActiveRecord.php(144): CComponent->__get("text")
#1
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/helpers/CHtml.php(2044): CActiveRecord->__get("text")
#2
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/helpers/CHtml.php(1774): CHtml::resolveValue(Content, "text")
#3
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/helpers/CHtml.php(1205): CHtml::activeInputField("text", Content, "text", array("maxlength" => 255, "name" => "Content[text]", "id" => "Content_text"))
#4
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/widgets/CActiveForm.php(575): CHtml::activeTextField(Content, "text", array("maxlength" => 255))
#5
– /var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/admin/modules/content/views/main/_form_primary.php(51): CActiveForm->textField(Content, "text", array("maxlength" => 255))
46
47
48 <div class="formRow">
49 <?php echo $form->labelEx($model,'text'); ?>
50 <div class="formRight">
51 <?php echo $form->textField($model, 'text', array('maxlength'=>255)); ?>
52 </div>
53 <div class="clear"></div>
54 </div>
55
56 <div class="formRow">
#6
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(127): require("/var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/...")
#7
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(96): CBaseController->renderInternal("/var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/...", array("model" => Content, "breadcrumbs" => array(array("name" => "Главный уровень", "url" => null)), "form" => CActiveForm, "sets" => array(Sets, Sets, Sets, Sets, ...), ...), true)
#8
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(870): CBaseController->renderFile("/var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/...", array("model" => Content, "breadcrumbs" => array(array("name" => "Главный уровень", "url" => null)), "form" => CActiveForm, "sets" => array(Sets, Sets, Sets, Sets, ...), ...), true)
#9
– /var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/admin/modules/content/views/main/add.php(66): CController->renderPartial("_form_primary", array("model" => Content, "breadcrumbs" => array(array("name" => "Главный уровень", "url" => null)), "form" => CActiveForm, "sets" => array(Sets, Sets, Sets, Sets, ...), ...))
61 'model' => $model,
62 'breadcrumbs' => $breadcrumbs,
63 'form' => $form,
64 'sets' => $sets,
65 'theme' => $theme
66 )); ?>
67
68 </div>
69 <!-- parent tab -->
70 <div id="parent" class="tab_content">
71 <?php echo $this->renderPartial('_form_parent', array(
#10
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(127): require("/var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/...")
#11
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CBaseController.php(96): CBaseController->renderInternal("/var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/...", array("pathIds" => array(1), "tree" => array(array("id" => 1, "name" => "Главный уровень", "url" => "/", "parent" => null), array("id" => "70000", "name" => "Главная", "url" => "/", "parent" => "1"), array("id" => "2", "name" => "Новые автомобили", "url" => "/auto", "parent" => "1"), array("id" => "92", "name" => "Lifan", "url" => "/auto/lifan", "parent" => "2"), ...), "sets" => array(Sets, Sets, Sets, Sets, ...), "model" => Content, ...), true)
#12
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(870): CBaseController->renderFile("/var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/...", array("pathIds" => array(1), "tree" => array(array("id" => 1, "name" => "Главный уровень", "url" => "/", "parent" => null), array("id" => "70000", "name" => "Главная", "url" => "/", "parent" => "1"), array("id" => "2", "name" => "Новые автомобили", "url" => "/auto", "parent" => "1"), array("id" => "92", "name" => "Lifan", "url" => "/auto/lifan", "parent" => "2"), ...), "sets" => array(Sets, Sets, Sets, Sets, ...), "model" => Content, ...), true)
#13
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(783): CController->renderPartial("add", array("pathIds" => array(1), "tree" => array(array("id" => 1, "name" => "Главный уровень", "url" => "/", "parent" => null), array("id" => "70000", "name" => "Главная", "url" => "/", "parent" => "1"), array("id" => "2", "name" => "Новые автомобили", "url" => "/auto", "parent" => "1"), array("id" => "92", "name" => "Lifan", "url" => "/auto/lifan", "parent" => "2"), ...), "sets" => array(Sets, Sets, Sets, Sets, ...), "model" => Content, ...), true)
#14
– /var/www/user118605/data/www/s118605.smrtp.ru/protected/modules/admin/modules/content/controllers/MainController.php(114): CController->render("add", array("pathIds" => array(1), "tree" => array(array("id" => 1, "name" => "Главный уровень", "url" => "/", "parent" => null), array("id" => "70000", "name" => "Главная", "url" => "/", "parent" => "1"), array("id" => "2", "name" => "Новые автомобили", "url" => "/auto", "parent" => "1"), array("id" => "92", "name" => "Lifan", "url" => "/auto/lifan", "parent" => "2"), ...), "sets" => array(Sets, Sets, Sets, Sets, ...), "model" => Content, ...))
109 'pathIds' => $pathIds,
110 'tree' => $this->loadTreeAntares($model->id),
111 'sets' => $sets,
112 'model' => $model,
113 'breadcrumbs' => $breadcrumbs
114 ));
115 }
116
117 public function actionEdit($id)
118 {
119 // получаем наборы
#15
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/actions/CInlineAction.php(50): MainController->actionAdd()
#16
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(309): CInlineAction->runWithParams(array())
#17
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/filters/CFilterChain.php(134): CController->runAction(CInlineAction)
#18
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/filters/CFilter.php(41): CFilterChain->run()
#19
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(1146): CFilter->filter(CFilterChain)
#20
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/filters/CInlineFilter.php(59): CController->filterAccessControl(CFilterChain)
#21
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/filters/CFilterChain.php(131): CInlineFilter->filter(CFilterChain)
#22
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(292): CFilterChain->run()
#23
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CController.php(266): CController->runActionWithFilters(CInlineAction, array("accessControl"))
#24
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CWebApplication.php(276): CController->run("add")
#25
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/web/CWebApplication.php(135): CWebApplication->runController("admin/content/main/add")
#26
+ /var/www/user118605/data/www/s118605.smrtp.ru/framework/base/CApplication.php(162): CWebApplication->processRequest()
#27
– /var/www/user118605/data/www/s118605.smrtp.ru/index.php(16): CApplication->run()
11 defined('YII_DEBUG') or define('YII_DEBUG', true);
12 // specify how many levels of call stack should be shown in each log message
13 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
14
15 require_once($yii);
16 Yii::createWebApplication($config)->run();

kukuruku
Сообщения: 1263
Зарегистрирован: 2011.02.14, 11:36

Re: CException

Сообщение kukuruku » 2018.11.22, 09:43

значит в таблице Content нет поля text

Ответить