johnitvn / yii2-rbac-plus

Database role base access control manager for yii2
49 stars 52 forks source link

UnknownMethodException while saving changed role #6

Closed stj-mv closed 9 years ago

stj-mv commented 9 years ago

Framework: Yii 2.0.6 Version: 1.0.0

Seems as if the beforeSave() call is not needed ...

StackTrace:

[error][yii\base\UnknownMethodException] exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: johnitvn\rbacplus\models\Role::beforeSave()' in .../yii/advanced/vendor/yiisoft/yii2/base/Component.php:285 Stack trace:

0 .../yii/advanced/vendor/johnitvn/yii2-rbac-plus/src/models/AuthItem.php(98): yii\base\Component->__call('beforeSave', Array)

1 .../yii/advanced/vendor/johnitvn/yii2-rbac-plus/src/models/AuthItem.php(98): johnitvn\rbacplus\models\Role->beforeSave()

2 .../yii/advanced/vendor/johnitvn/yii2-rbac-plus/src/controllers/RoleController.php(155): johnitvn\rbacplus\models\AuthItem->save()

3 [internal function]: johnitvn\rbacplus\controllers\RoleController->actionUpdate('admin')

ghost commented 9 years ago

Framework: Yii 2.0.6 Version: 1.0.0

Seems the AfterSave() call is not needed to. It throws UnknownMethodException like in upper comment.

johnitvn commented 9 years ago

Why do you not update to version 1.0.2 :disappointed:

ghost commented 9 years ago

I install module throw composer and update it, but bug still here. If i remove call $this->beforeSave() and $this->afterSave(..) from model - all works fine! Try it yourself on Yii 2.0.6. P.S. Composer now gets version 1.0.2! And AuthItem model havent beforeSave and afterSave empty methods, but have them calling. P.P.S. Sorry for my english.

stj-mv commented 9 years ago

Same as I did. Installed via Composer and get version 1.0.2 Sorry for the wrong version number in my first post.

johnitvn commented 9 years ago

Sorry for late reply. Look like yii update afterSave() method in 2.0.6. I will update now