Skip to content

DB error when overwriting table names #213

Description

@neuronet77

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions