user-management icon indicating copy to clipboard operation
user-management copied to clipboard

DB error when overwriting table names

Open neuronet77 opened this issue 4 years ago • 0 comments

Module config in web.php:

` 'modules' => [

    'user-management' => [
        'controllerMap'         => [
            'user' => 'app\controllers\UserController',
        ],
        'class'                 => 'webvimark\modules\UserManagement\UserManagementModule',
        'enableRegistration'    => false,
        'passwordRegexp'        => '^\S*(?=\S{8,})(?=\S*[a-z])(?=\S*[A-Z])(?=\S*[\d])\S*$^',
        'on beforeAction'       => function (yii\base\ActionEvent $event) {
            if ($event->action->uniqueId == 'user-management/auth/login') {
                $event->action->controller->layout = 'loginLayout.php';
            };
        },
        'user_table'            => 'ea_user',
        'user_visit_log_table'  => 'ea_user_visit_log',
        'auth_item_table'       => 'ea_auth_item',
        'auth_item_child_table' => 'ea_auth_item_child',
        'auth_item_group_table' => 'ea_auth_item_group',
        'auth_assignment_table' => 'ea_auth_assignment',
        'auth_rule_table'       => 'ea_auth_rule'
    ],
],

`

Upon login I get the following error message:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.auth_assignment' doesn't exist The SQL being executed was: SELECT b.* FROM auth_assignment a, auth_item b WHERE (a.item_name=b.name) AND (a.user_id='1') AND (b.type=1)

It gets triggered in

\vendor\webvimark\module-user-management\models\rbacDB\Role.php Line 23

return $dbManager->getRolesByUser($userId);

It seems like the custom table names are not getting handed over to the

yii\rbac\DbManager

neuronet77 avatar Mar 29 '20 15:03 neuronet77