Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not load model when add new root #171

Closed
tentruycapcuaban opened this issue Aug 23, 2017 · 5 comments
Closed

can not load model when add new root #171

tentruycapcuaban opened this issue Aug 23, 2017 · 5 comments

Comments

@tentruycapcuaban
Copy link

tentruycapcuaban commented Aug 23, 2017

hi kartik, can you show me how to fix it???

{"name":"Exception","message":"This operation is not allowed.","code":0,"type":"yii\\base\\InvalidCallException","file":"D:\\wamp64\\www\\thsams\\vendor\\kartik-v\\yii2-tree-manager\\controllers\\NodeController.php","line":128,"stack-trace":["#0 D:\\wamp64\\www\\thsams\\vendor\\kartik-v\\yii2-tree-manager\\controllers\\NodeController.php(286): kartik\\tree\\controllers\\NodeController::checkValidRequest()","#1 [internal function]: kartik\\tree\\controllers\\NodeController->actionManage()","#2 D:\\wamp64\\www\\thsams\\vendor\\yiisoft\\yii2\\base\\InlineAction.php(55): call_user_func_array(Array, Array)","#3 D:\\wamp64\\www\\thsams\\vendor\\yiisoft\\yii2\\base\\Controller.php(151): yii\\base\\InlineAction->runWithParams(Array)","#4 D:\\wamp64\\www\\thsams\\vendor\\yiisoft\\yii2\\base\\Module.php(455): yii\\base\\Controller->runAction('manage', Array)","#5 D:\\wamp64\\www\\thsams\\vendor\\yiisoft\\yii2\\web\\Application.php(84): yii\\base\\Module->runAction('treemanager/nod...', Array)","#6 D:\\wamp64\\www\\thsams\\vendor\\yiisoft\\yii2\\base\\Application.php(375): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))","#7 D:\\wamp64\\www\\thsams\\web\\index.php(12): yii\\base\\Application->run()","#8 {main}"]}

image

@tentruycapcuaban
Copy link
Author

look seem can not load _form

@Spillo89
Copy link

I have the same issue, do you have fixed in some ways?

@kazykenov
Copy link

Faced the same issue, seems that Trait implementation is not working (as Tree extend method works well)

@kartik-v
Copy link
Owner

kartik-v commented Dec 20, 2017

Faced the same issue, seems that Trait implementation is not working (as Tree extend method works well)

With the trait implementation you need to define all the other public properties in your model as mentioned in the documentation for setting up your model. You can also cross check the default model class kartik\tree\models\Tree to check which properties you must define.

Also you cannot just override the methods in the trait approach as parent::methodname() or parent::rules() will not work - check the doc example above - how you need to extend the methods of the trait.

@kartik-v
Copy link
Owner

kartik-v commented Dec 20, 2017

On the model not loading - just debug your code to show the error messages of the model.

Note that the TreeView widget on load expects a displayValue which is equal to the id primary key value and is important to show the default node model when initializing the tree view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants