I've managed to find the solution on my own. The problem was in the model 'Category'. I changed the validation rules so that 'lft', 'rgt' and 'level' are not required, since these are automatically added by NestedSetBehavior.
Before change:
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('lft, rgt, level', 'required'),
array('level', 'numerical', 'integerOnly'=>true),
array('root, lft, rgt', 'length', 'max'=>10),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, root, lft, rgt, level', 'safe', 'on'=>'search'),
);
}
After Change:
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
//array('lft, rgt, level', 'required'),
array('level', 'numerical', 'integerOnly'=>true),
array('root, lft, rgt', 'length', 'max'=>10),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, root, lft, rgt, level', 'safe', 'on'=>'search'),
);
}
It's working perfectly now.