I got the same error as in the original post. However, when I tried the fix that the original poster used, I got more errors
Here’s the code that the OP used to solve the problem
public function actionView($id)
{
$issueDataProvider=new CActiveDataProvider('Issue', array(
'criteria'=>array(
'condition'=>'project_id=:projectId',
'params'=>array(':projectId'=>$this->loadModel($id)->id),
),
'pagination'=>array(
'pageSize'=>1,
),
));
$this->render('view',array(
'model'=>$this->loadModel($id),
'issueDataProvider'=>$issueDataProvider,
));
This is the error message I got when I tried the solution
]CException
Issue does not have a method named "getTypeText".
/Applications/MAMP/htdocs/framework/base/CComponent.php(266)
254 public function __call($name,$parameters)
255 {
256 if($this->_m!==null)
257 {
258 foreach($this->_m as $object)
259 {
260 if($object->getEnabled() && method_exists($object,$name))
261 return call_user_func_array(array($object,$name),$parameters);
262 }
263 }
264 if(class_exists('Closure', false) && $this->canGetProperty($name) && $this->$name instanceof Closure)
265 return call_user_func_array($this->$name, $parameters);
266 throw new CException(Yii::t('yii','{class} does not have a method named "{name}".',
267 array('{class}'=>get_class($this), '{name}'=>$name)));
268 }
269
270 /**
271 * Returns the named behavior object.
272 * The name 'asa' stands for 'as a'.
273 * @param string $behavior the behavior name
274 * @return IBehavior the behavior object, or null if the behavior does not exist
275 * @since 1.0.2
276 */
277 public function asa($behavior)
278 {[/b]
}
And this is the stack trace
[b]Stack Trace
#0
- /Applications/MAMP/htdocs/framework/db/ar/CActiveRecord.php(213): CComponent->__call("getTypeText", array())
#1
– /Applications/MAMP/htdocs/trackstar/protected/views/issue/_view.php(13): CActiveRecord->__call("getTypeText", array())
08 <?php echo CHtml::encode($data->description); ?>
09 <br />
10
11 <b><?php echo CHtml::encode($data->getAttributeLabel(‘type_id’)); ?>:</b>
12 <?php //echo CHtml::encode($data->type_id); ?>
13 <?php echo CHtml::encode($data->getTypeText()); ?>
14 <br />
15
16 <b><?php echo CHtml::encode($data->getAttributeLabel(‘status_id’)); ?>:</b>
17 <?php //echo CHtml::encode($data->status_id); ?>
18 <?php echo CHtml::encode($data->getStatusText()); ?>
#2
– /Applications/MAMP/htdocs/trackstar/protected/views/issue/_view.php(13): Issue->getTypeText()
08 <?php echo CHtml::encode($data->description); ?>
09 <br />
10
11 <b><?php echo CHtml::encode($data->getAttributeLabel(‘type_id’)); ?>:</b>
12 <?php //echo CHtml::encode($data->type_id); ?>
13 <?php echo CHtml::encode($data->getTypeText()); ?>
14 <br />
15
16 <b><?php echo CHtml::encode($data->getAttributeLabel(‘status_id’)); ?>:</b>
17 <?php //echo CHtml::encode($data->status_id); ?>
18 <?php echo CHtml::encode($data->getStatusText()); ?>[/b]