Olá pessoal,
Esse erro ta me matando aki…
Ao clicar no nome de algumas colunas no Gridview para ordernar, esta abrindo um pop com a seguinte mensagem de erro:
Error 500: <h1>PHP Error [8]</h1>
<p>Trying to get property of non-object (C:\wamp\www\Teste\yii\framework\base\CComponent.php(607) : eval()'d code:1)</p>
<pre>#0 C:\wamp\www\Teste\yii\framework\base\CComponent.php(607) : eval()'d code(1): CWebApplication->handleError()
#1 C:\wamp\www\Teste\yii\framework\base\CComponent.php(607): eval()
#2 C:\wamp\www\Teste\yii\framework\zii\widgets\grid\CDataColumn.php(132): CDataColumn->evaluateExpression()
#3 C:\wamp\www\Teste\yii\framework\zii\widgets\grid\CGridColumn.php(142): CDataColumn->renderDataCellContent()
#4 C:\wamp\www\Teste\yii\framework\zii\widgets\grid\CGridView.php(576): CDataColumn->renderDataCell()
#5 C:\wamp\www\Teste\yii\framework\zii\widgets\grid\CGridView.php(549): CGridView->renderTableRow()
#6 C:\wamp\www\Teste\yii\framework\zii\widgets\grid\CGridView.php(459): CGridView->renderTableBody()
#7 C:\wamp\www\Teste\yii\framework\zii\widgets\CBaseListView.php(161): CGridView->renderItems()
#8 unknown(0): CGridView->renderSection()
#9 C:\wamp\www\Teste\yii\framework\zii\widgets\CBaseListView.php(144): preg_replace_callback()
#10 C:\wamp\www\Teste\yii\framework\zii\widgets\CBaseListView.php(129): CGridView->renderContent()
#11 C:\wamp\www\Teste\yii\framework\web\CBaseController.php(174): CGridView->run()
#12 C:\wamp\www\Teste\controle_visitas_novo\protected\views\visitas\admin.php(107): VisitasController->widget()
#13 C:\wamp\www\Teste\yii\framework\web\CBaseController.php(127): require()
#14 C:\wamp\www\Teste\yii\framework\web\CBaseController.php(96): VisitasController->renderInternal()
#15 C:\wamp\www\Teste\yii\framework\web\CController.php(870): VisitasController->renderFile()
#16 C:\wamp\www\Teste\yii\framework\web\CController.php(783): VisitasController->renderPartial()
#17 C:\wamp\www\Teste\controle_visitas_novo\protected\controllers\VisitasController.php(143): VisitasController->render()
#18 C:\wamp\www\Teste\yii\framework\web\actions\CInlineAction.php(50): VisitasController->actionAdmin()
#19 C:\wamp\www\Teste\yii\framework\web\CController.php(309): CInlineAction->runWithParams()
#20 C:\wamp\www\Teste\yii\framework\web\filters\CFilterChain.php(134): VisitasController->runAction()
#21 C:\wamp\www\Teste\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
#22 C:\wamp\www\Teste\yii\framework\web\CController.php(1146): CAccessControlFilter->filter()
#23 C:\wamp\www\Teste\yii\framework\web\filters\CInlineFilter.php(59): VisitasController->filterAccessControl()
#24 C:\wamp\www\Teste\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter()
#25 C:\wamp\www\Teste\yii\framework\web\CController.php(292): CFilterChain->run()
#26 C:\wamp\www\Teste\yii\framework\web\CController.php(266): VisitasController->runActionWithFilters()
#27 C:\wamp\www\Teste\yii\framework\web\CWebApplication.php(283): VisitasController->run()
#28 C:\wamp\www\Teste\yii\framework\web\CWebApplication.php(142): CWebApplication->runController()
#29 C:\wamp\www\Teste\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
#30 C:\wamp\www\Teste\controle_visitas_novo\index.php(13): CWebApplication->run()
</pre>
O estranho é que isso somente acontece no ambiente que irá rodar o sistema (Windows 2003, PHP 5.2.11), no meu ambiente de desenvolvimento (Ubuntu, PHP 5.3.8 ) isso não acontece.
Minha grid ta assim:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'visitas-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'cssFile'=>'css/my_grid.css',
'pager'=>array(
'header'=>'Paginas',
'cssFile'=>'css/my_pager.css',
),
'columns'=>array(
'id_controle_visita',
array(
'name'=>'id_gerente',
'value'=>'$data->idGerente->nome_gerente',
'type'=>'text',
'header'=>'Gerente',
'filter'=>CHtml::listData(Gerente::model()->findAll(), 'id_gerente', 'nome_gerente'),
),
'data_hora',
//'responsavel',
'emp_pessoa',
array(
'name'=>'id_finalidade',
'value'=>'$data->idFinalidade->desc_finalidade',
'type'=>'text',
'header'=>'Finalidade',
'filter'=>CHtml::listData(Finalidades::model()->findAll(), 'id_finalidade', 'desc_finalidade'),
),
array(
'name'=>'id_status',
'value'=>'$data->idStatus->desc_status',
'type'=>'text',
'header'=>'Status',
'filter'=>CHtml::listData(Status::model()->findAll(), 'id_status', 'desc_status'),
),
array(
'name'=>'id_tipo_pessoa',
'value'=>'$data->idTipoPessoa->desc_tipo_pessoa',
'type'=>'text',
'header'=>'Tipo',
'filter'=>CHtml::listData(TipoPessoa::model()->findAll(), 'id_tipo_pessoa', 'desc_tipo_pessoa'),
),
//'id_agencia',
array(
'name'=>'id_agencia',
'value'=>'$data->idAgencia->sigla_agencia',
'type'=>'text',
'header'=>'Agencia',
'filter'=>CHtml::listData(Agencia::model()->findAll(), 'id_agencia', 'sigla_agencia'),
),
array(
'class'=>'CButtonColumn',
),
),
)); ?>