Plus, I am also using Giix to generate Model and Crud.
In this case, when I click the button save in the webpage xxx/create, I got the following error:
"You should not use CActiveRecord::save() method when NestedSetBehavior attached."
After reading the document for NestedSetBehavior (http://www.yiiframework.com/extension/nestedsetbehavior/) , I found if I want to create a new model, I should use saveNode() instead of save(). However, the problem is, I used Giix to generate the Crud, so in the actionCreate function of XXController is:
if ($model->saveWithRelated($relatedData)) {
if (Yii::app()->getRequest()->getIsAjaxRequest())
Yii::app()->end();
else
$this->redirect(array('view', 'id' => $model->id));
}
which means it uses saveWithRelated() rather than save(). So I cannot use saveNode() to rewrite the function either.
So, please what should I do to save the model???
I hope this description is clear. If not, please tell me, I will try again.