RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.22k stars 10.42k forks source link

Empty role in Edit User #21599

Open emikolajczak opened 3 years ago

emikolajczak commented 3 years ago

Description:

When you try to Edit User, empty role is show by GUI. When you try to save an error "The field Roles consist invalid role" appears. When you remove this role you can seve. But when you Edit User again, empty role still presented. Detail on video below.

Steps to reproduce:

  1. Go to Edit User in Admin panel
  2. Check roles field, contains empty role
  3. Try to save. An error occurred.

Expected behavior:

No Empty roles presented

Actual behavior:

Empty role in Edit User

Server Setup Information:

Client Setup Information

Additional context

https://user-images.githubusercontent.com/50440047/114980365-a4a7c300-9e8c-11eb-90b3-3af1a9b42859.mp4

Relevant logs:

emikolajczak commented 3 years ago

I found that is caused by Custom Field

{
 "TypUżytkownika": {
  "type": "select",
  "defaultValue": "Dev",
  "options": ["Dev", "Analyst"],
  "required": true,
  "modifyRecordField": {
   "array": true,
   "field": "roles"
  }
Jeanstaquet commented 3 years ago

Hello @emikolajczak, In my case, I have created new roles, and other data and I can't reproduce the bug, which CustomField do you talk about ?

emikolajczak commented 3 years ago

Hi @Jeanstaquet . Custom fields definition in Admin -> Accounts -> Registration -> Custom Fields

Jeanstaquet commented 3 years ago

ok thanks @emikolajczak, I managed to reproduce it, I'm working on it

Jeanstaquet commented 3 years ago

I finally found, i'm preparing a PR

yash-rajpal commented 3 years ago

I have already made a pr for this, Please check #20919

I think it solves this issue.