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

Error: Call to undefined method app\models\User::setInstance() #453

Open
strtob opened this issue Jul 6, 2021 · 0 comments
Open

Error: Call to undefined method app\models\User::setInstance() #453

strtob opened this issue Jul 6, 2021 · 0 comments

Comments

@strtob
Copy link

strtob commented Jul 6, 2021

Hi guys,

I try to reach /admin/route/index

but I got this error:

Error
Call to undefined method app\models\User::setInstance()

    1. in vendor/yiisoft/yii2/base/Module.php at line 428
    2. in /vendor/mdmsoft/yii2-admin/models/Route.php at line 211 – yii\base\Module::getModule()
    205206207208209210211212213214215216217

        protected function getRouteRecursive($module, &$result)
        {
            $token = "Get Route of '" . get_class($module) . "' with id '" . $module->uniqueId . "'";
            Yii::beginProfile($token, __METHOD__);
            try {
                foreach ($module->getModules() as $id => $child) {
                    if (($child = $module->getModule($id)) !== null) {
                        $this->getRouteRecursive($child, $result);
                    }
                }
     
                foreach ($module->controllerMap as $id => $type) {
                    $this->getControllerActions($type, $id, $module, $result);

my user component look like these:

 'user' => [
          'identityClass' => 'app\models\User',
          'enableAutoLogin' => true,
          'loginUrl' => ['site/login'],
        ],

Any ideas?

Thanks a lot!
Tobi

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

1 participant