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

为用户设置一个为空的角色会导致角色列表报错 #6604

Closed
LIlGG opened this issue Sep 6, 2024 · 1 comment · Fixed by #6612
Closed

为用户设置一个为空的角色会导致角色列表报错 #6604

LIlGG opened this issue Sep 6, 2024 · 1 comment · Fixed by #6612
Assignees
Labels
area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@LIlGG
Copy link
Member

LIlGG commented Sep 6, 2024

系统信息

使用的哪种方式运行?

Docker Compose

发生了什么?

在角色列表中可以将用户设置为 ”请选择角色“,在 2.19.x 中执行此操作会导致后端 roles 返回一个 null 值,进而导致前台报错。

/kind bug
/area ui
/area core

复现步骤

  1. 打开用户列表
  2. 设置某个用户角色为 “请选择角色"

相关日志输出

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'metadata')
    at UserList.vue:477:32
    at renderFnWithContext (vue.global.fe3b2080.js:2399:15)
    at Object.renderSlot (vue.global.fe3b2080.js:4510:55)
    at Proxy.<anonymous> (halo-components.iife.fe3b2080.js:9:109643)
    at renderComponentRoot (vue.global.fe3b2080.js:2459:18)
    at ReactiveEffect.componentUpdateFn [as fn] (vue.global.fe3b2080.js:7505:48)
    at ReactiveEffect.run (vue.global.fe3b2080.js:539:21)
    at vue.global.fe3b2080.js:7636:18
    at setupRenderEffect (vue.global.fe3b2080.js:7646:7)
    at mountComponent (vue.global.fe3b2080.js:7414:9)

附加信息

No response

@f2c-ci-robot f2c-ci-robot bot added kind/bug Categorizes issue or PR as related to a bug. area/ui Issues or PRs related to the Halo UI area/core Issues or PRs related to the Halo Core labels Sep 6, 2024
@JohnNiang
Copy link
Member

/milestone 2.19.x
/assign

@f2c-ci-robot f2c-ci-robot bot added this to the 2.19.x milestone Sep 6, 2024
@JohnNiang JohnNiang removed the area/ui Issues or PRs related to the Halo UI label Sep 6, 2024
f2c-ci-robot bot pushed a commit that referenced this issue Sep 6, 2024
#### What type of PR is this?

/kind bug
/area core
/milestone 2.20.x

#### What this PR does / why we need it:

This PR filters blank role name while granting roles for an user to prevent null role in permissions.

#### Which issue(s) this PR fixes:

Fixes #6604

#### Does this PR introduce a user-facing change?

```release-note
修复取消用户角色后无法正常渲染用户列表的问题
```
@JohnNiang JohnNiang modified the milestones: 2.19.x, 2.19.2 Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants