2amigos / yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension
https://github.com/2amigos/yii2-usuario
Other
294 stars 142 forks source link

Try to login: ActiveQuery: Exception 'Error' with message 'Class name must be a valid object or a string' #494

Closed strtob closed 1 year ago

strtob commented 1 year ago

I try to login an get the following error after press the submit button:

`

Exception 'Error' with message 'Class name must be a valid object or a string' 

in /opt/work/real-hive/vendor/yiisoft/yii2/db/ActiveQuery.php:324

Stack trace:

0 /opt/work/real-hive/vendor/yiisoft/yii2/db/Query.php(287): yii\db\ActiveQuery->createCommand()

1 /opt/work/real-hive/vendor/yiisoft/yii2/db/ActiveQuery.php(304): yii\db\Query->one()

2 /opt/work/real-hive/backend/components/modules/User/Form/LoginForm.php(179): yii\db\ActiveQuery->one()

3 /opt/work/real-hive/vendor/yiisoft/yii2/base/Model.php(351): backend\components\modules\User\Form\LoginForm->beforeValidate()

4 /opt/work/real-hive/vendor/yiisoft/yii2/widgets/ActiveForm.php(419): yii\base\Model->validate()

5 /opt/work/real-hive/backend/components/modules/User/Controller/SecurityController.php(136): yii\widgets\ActiveForm::validate()

6 [internal function]: backend\components\modules\User\Controller\SecurityController->actionLogin()

7 /opt/work/real-hive/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()

8 /opt/work/real-hive/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()

9 /opt/work/real-hive/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()

10 /opt/work/real-hive/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()

11 /opt/work/real-hive/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()

12 /opt/work/real-hive/backend/web/index.php(18): yii\base\Application->run()

13 {main}

`
maxxer commented 1 year ago

Check the backend/components/modules/User/Form/LoginForm.php(179) file in your project

strtob commented 1 year ago

Thanks for your support! The problem was in my case that the Bootstrap class of the module needs to be set in the bootstrap array of the config file.