I have used the crud generator for the product table, but as you will be aware, I am now faced with turning id's into names.
I am faced with an error caused by my customised view.php when trying to call getAttributeLabel on a non-object.
The problem is that the country field is nullable field. If the country is not set (i.e. null), i get the error.
<?php $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=>array( 'id', 'product_type_id', array( 'label' => $model->country->getAttributeLabel('country'), 'value' => $model->country->country ), 'name', ), )); ?>
Any recommendations on how to fix this?