Posts Tagged with error 500

Displaying 1-3 of 3 results.
Resolved: Yii 1 - Error 500 - include(DOMDocument.php): failed to open stream: No such file or directory
posted by admin on July 19, 2017
I move my Yii1 project from shared hosting to VDS VPS Ubuntu hosting and get some error

Error 500 - include(DOMDocument.php): failed to open stream: No such file or directory

In shared hosting my php version is 5.7, in new hosting my php version is 7.0.*Read more
Resolved: Yii CGridView pagination not working and alert 500 or 404 error
posted by admin on April 23, 2016
I have trouble about cgridview pagination.
I am using admin page(/{module}/admin that) generated by gii.
it has search form and grid with pagination. its work well without urlmanager

but my team have create urlmanager rule long ago.

'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<module>/<controller>/<action>',

),
),


when I use admin page with this urlmanager rule. It has some problem.
- if not using grid sort or pagination. I can filter in grid and form.
- but if using sort or pagination. I can not filtering in grid and form anymore.

page link is wierd and i think because of some attribute(params) are null like this

/{module}/{controller}/admin/BookManageMain%5Bbmm_code%5D//BookManageMain%5Bbmm_tid%5D/2/.../BookManageMain_page/2/ajax/book-manage-main-grid

if I am copy this url to another tab and Its can not filtering in grid and form too.
but if I remove attribute that has null value(BookManageMain%5Bbmm_code%5D//) I can filter grid and form.

/{module}/{controller}/admin/BookManageMain%5Bbmm_tid%5D/2/.../BookManageMain_page/2/ajax/book-manage-main-grid

console log (not sure filter use POST and sort/page use GET)

before click pagerlink or sorting
.../{controller}/action?BookManageMain%5Bbmm_code%5D=&BookManageMain%5Bbmm_tid%5D=2&...&BookManageMain_page=1&ajax=book-manage-main-grid

after click

.../{controller}/action/BookManageMain%5Bbmm_code%5D//BookManageMain%5Bbmm_tid%5D/2/.../BookManageMain_page/2/ajax/book-manage-main-grid
Read more
Resolved: Yii 1.1 CGridView Error 500 Trying to get property of non-object
posted by admin on April 8, 2016
I have CGridView with relation

admin.php in Media view

<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'media-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'caption',
array(
'name' => 'gallery_id',
'value' => '$data->gallery->name',
'filter' => CHtml::listData(Gallery::model()->findAll(), 'id', 'name'),
),
),
array(
'class'=>'CButtonColumn',
),
),
)); ?>


Gallery.php Model

class Gallery extends CActiveRecord
{
. . .
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
. . .
'gallery' => array(self::HAS_MANY, 'Media', 'gallery_id'),
);
}
. . .
}


Media.php Model

class Media extends CActiveRecord
{

public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
. . .
'gallery' => array(self::BELONGS_TO, 'Gallery', 'gallery_id'),
);
}
}


I see this error

Error 500
Trying to get property of non-object


Error in line

'value' => '$data->gallery->name',
Read more