-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
User Save fail if Optional Custom Select Field is left empty #8070
Comments
Additional Information: Its not type Improvement. I would say its type Bug or Release Candidate Bug because using Custom Select Fields worked until 0.58.2 with the Trick to add an empty String as first Selectable Item. After the Change in 0.59.0-rc.0 (the first Version the Bug appeared) the Profile Setting Form added an empty String as first Option (what is an improvement for the previously used Hack). But not being able to save the Profile without selecting an Option or having 2 empty Select Options if I continue using the previous Hack is not an applicable Solution. So Please finnisch the Change the right way and allow to save the empty value for Optional Select Fields or remove the auto added empty field to continue the previous Hack. The Required Validation for Text Fields work fine. Additionally: there is a Layout Issue in Frontend Profile Settings: Having more then 2 Custom Fields in Desktop View the appeared in one row and the 3rd field have no Padding to the 2nd one. |
@xlbs-rm Do you have access to the MongoDB? There's a collection name |
In 0.59.0-rc.0 the Following Example: { Results in: Short, with Frontend Behaviour Description: Original Output:
{ "_id" : "Accounts_CustomFields", "type" : "code", "public" : true, "i18nLabel" : "Custom_Fields", "group" : "Accounts", "section" : "Registration", "packageValue" : "", "valueSource" : "packageValue", "hidden" : false, "blocked" : false, "sorter" : 31, "i18nDescription" : "Accounts_CustomFields_Description", "ts" : ISODate("2017-09-12T10:27:58.999Z"), "_updatedAt" : ISODate("2017-09-13T07:20:19.898Z"), "createdAt" : ISODate("2017-09-12T10:27:58.998Z"), "value" : "{\n"gender": {\n"type": "select",\n"options": ["female", "male"],\n"required": false\n},\n"field1": {\n"type": "select",\n"options": [" ", "a", "b"],\n"required": false\n}\n}" } |
@xlbs-rm @MartinSchoeler I did some digging and it turns out custom fields are treated differently in the registration form (detects old RC) and the profile form (detects new RC). Moreover, the empty value in the new RC is not included in the options on the server side when doing the validation. |
Confirm that:
I cant say anything about the Server Side Validation because I only use the docker out of the Box Server. The Bug is still there in 0.59.0-rc.9 There is also UI Layout Bug for more than 3 Custom Fields. They are displayed in one Line / No Line Break. |
@xlbs-rm That's correct.
|
The Bug is still there in 0.60.2: REST API create a Profile with an |
Same in 2023 in version 6.1.5. of Rocketchat I have the following custom fields I use Rocketchat API to create a new user and I send the following payload: Later edit: I've even added "defaultValue":"General medicine", for the select but nothing changed WHY, if I declared the cfSpecialization as optional and also I don't include it in payload I get that error? WHY, if I don't include customFields object in payload, the user is created in Rocketchat? |
Description:
Leave optional (Required false) type select custom Fields empty and Save Users Profile not working.
Show: error-user-registration-custom-field
Not saving Changes
Fill fields would be able to save.
Additional Note Previous Versions needed an empty option also for not required Fields, this seems to be imptoved now. Attached Custom Field COnfig will produce 2 empty fields for Gender. Removing the first empty option will also not solve the Saving Issue.
Server Setup Information:
Steps to Reproduce:
{
"user_gender": {
"type": "select",
"options": [" ", "female", "male"],
"required": false
},
"phone": {
"type": "text",
"maxLength": 20,
"required": false
},
"description": {
"type": "text",
"required": false
}
}
Expected behavior:
Saving Changes
Actual behavior:
Not Saving Changes
Relevant logs:
No Logs on server
WSS Log
"{"msg":"result","id":"17","error":{"isClientSafe":true,"error":"error-user-registration-custom-field","reason":"Value for field **REMOVED is invalid","details":{"method":"registerUser"},"message":"Value for field **REMOVED is invalid [error-user-registration-custom-field]","errorType":"Meteor.Error"}}
The text was updated successfully, but these errors were encountered: