RocketChat / RocketChat/Rocket.Chat

5.2.0 - Custom Fields - DefaultValue not working

Open
#27,131 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Custom fileds DefaultValue not shown (I did post there on a previous version : https://github.com/RocketChat/Rocket.Chat/issues/27034

Steps to reproduce:

Account --> Register --> Custom Fields

Add the page example :

{ "role": { "type": "select", "defaultValue": "student", "options": ["teacher", "student"], "required": true, "modifyRecordField": { "array": true, "field": "roles" } }, "twitter": { "type": "text", "required": true, "minLength": 2, "maxLength": 10 } }

Expected behavior:

See student as default

Actual behavior:

See teacher as default (the first entry)

Server Setup Information:
  • Version of Rocket.Chat Server: 5.2.0
  • Operating System:
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 14.19.3
  • MongoDB Version: 4.4.15
Client Setup Information
  • Desktop App or Browser Version: chromium
  • Operating System: ubuntu

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Account → Register → Custom Fields and reproduce the example configuration from the issue in Rocket.Chat 5.2.0. Trace how the select field chooses its initial value and compare defaultValue with the options order. Done means the registration form shows “student” as the default rather than the first option, with the behavior covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.