You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You likely attaching behavior in a controller for model like as $model->attachBehavior(
'nestedSetBehavior',
array(
'class' => 'application.behaviors.NestedSetBehavior',
'leftAttribute' => 'lft',
'rightAttribute' => 'rgt',
'levelAttribute' => 'level',
'hasManyRoots' => true,
)
);
If added new record in root, then it does not caused problem. But! If added new record in existing record, then will be caused problem, which you described.
This is due to the fact what after getting model in which you want insert new record, you not attach behavior for this model! If this not do, you get exception, because in behavior exist property for validate and checking. In this case this property private $_deleted=false; at line 23.
This was hidden behind a rollback failure! Reached this after I modified
if(isset($transaction) && $transaction->active)
(at line 662)
Exception Message: Category and its behaviors do not have a method or closure named "getIsDeletedRecord".
Trace:
#0 /yii/db/ar/CActiveRecord.php(225): CComponent->__call('getIsDeletedRec...', Array)
#1 /application/components/behaviors/NestedSetBehavior.php(904): CActiveRecord->__call('getIsDeletedRec...', Array)
#2 /application/components/behaviors/NestedSetBehavior.php(904): Category->getIsDeletedRecord()
#3 /application/components/behaviors/NestedSetBehavior.php(658): NestedSetBehavior->correctCachedOnAddNode('2')
#4 /application/components/behaviors/NestedSetBehavior.php(325): NestedSetBehavior->addNode(Object(Category), '2', 1, true, NULL)
#5 [internal function]: NestedSetBehavior->appendTo(Object(Category))
any quickfix ideas/solutions?
The text was updated successfully, but these errors were encountered: