Skip to content

Commit

Permalink
beforeFindなどで別テーブルをcontainする場合に、sqlエラーが出る問題を解消 (#2800)
Browse files Browse the repository at this point in the history
  • Loading branch information
kk-uchino authored Oct 12, 2023
1 parent a8f00e4 commit 83d3256
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Model/Validation/UserValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function willChangeSelfGroup($userGroup, $context)
}
$users = TableRegistry::getTableLocator()->get('BaserCore.Users');
/* @var User $loginUser */
$loginUser = $users->find()->contain('UserGroups')->where(['id' => $loginUserId])->first();
$loginUser = $users->find()->contain('UserGroups')->where(['Users.id' => $loginUserId])->first();
$loginGroupId = Hash::extract($loginUser->user_groups, '{n}.id');
if(in_array(Configure::read('BcApp.adminGroupId'), $loginGroupId)) {
return true;
Expand Down

0 comments on commit 83d3256

Please sign in to comment.