-
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
Can't save Accounts_CustomFields in ./packages/rocketchat-lib/server/startup/settings.js #9763
Comments
You can actually set custom fields through the admin interface, no need to touch the code ;) Example:
Administration -> Accounts -> Registration -> Custom Fields
Currently there's a bug in the Rocket.Chat User Info UI, which prevents custom fields to be shown. I already opened a PR (#9646) for that, so it should be fix with the next release. |
thanks for your help~ thank you very much 👍 |
Can other user who is not admin see the custom fields ? I also tried to call the rest api /api/v1/users.info?userId=xxx, il returns customFields only when called by admin user |
@kaiiiiiiiii Hi, |
Description:
I'm new to Rocket.Chat and I can not sure whether it is a bug, I'm debugging for this problem 2 days, can anyone please help?
I want to add some CustomFields in user's account, so I modify the setting in ./packages/rocketchat-lib/server/startup/settings.js
this.add('Accounts_CustomFields', '[HERE IS MY CUSTOM VALUE]', {
type: 'code',
'public': true,
i18nLabel: 'Custom_Fields'
});
and then I start the server in debug mode, I try to reg a new account throw REST API, in the file
./server/methods/registerUser.js there is a method call:
RocketChat.saveCustomFields(userId, formData); -->
if (s.trim(RocketChat.settings.get('Accounts_CustomFields')) !== '')
and the if test always return false because RocketChat.settings.get('Accounts_CustomFields') always return '' (empty string)
it seems the code in server/startup/settings.js just did not work, and i don't know why, can any one help me to figure out the problem? thanks
Server Setup Information:
Steps to Reproduce:
this.add('Accounts_CustomFields', '[HERE IS MY CUSTOM VALUE]', {...}
you can just type a 'test' string
let value = RocketChat.settings.get('Accounts_CustomFields');
console.log(value);
debugger;
in the saveCustomFields function, before the if test
Expected behavior:
in the log (or breakpoint) , the value of RocketChat.settings.get('Accounts_CustomFields');
show be test, not ''(empty string)
Actual behavior:
in the log (or breakpoint) , the value of RocketChat.settings.get('Accounts_CustomFields');
is alway ''(empty string), and the if test will fail, and can't save the CustomFields
The text was updated successfully, but these errors were encountered: