Custom User Field Required for All, but only Editable ONCE

Sorry if this has been brought up before, I found something yesterday that was close to it, but today my search terms bring up nothing.

Scenario:

A Discourse server wants to set a field, say Date of Birth, to be a required field. This shouldn’t be something that needs to be edited after signup. So the solution is to set the custom field to uncheck ‘editable after signup’ and then change the field to ‘Required on Signup’. This works for users creating an account through the typical email/username signup.

Issue 1:

Users that are creating accounts through things like OAuth, DiscourseID, WP-Discourse, etc never see these fields. In order to have these users have access to these fields, they must be marked Required For All which brings us to…

Issue 2:

Required For All, for obvious reasons, requires that a field be marked as ‘editable after signup’. This unfortunately also allows users to change the field whenever they want…which is not what we want at all.

Requested Feature:

Added logic that allows ‘Required For All’ to not require ‘editable after signup’ to be checked. The logic would first check to see if the field is empty or ‘null’ BEFORE checking to see what ‘editable after signup’ is set to. It would essentially ignore the editable checkbox for any empty/null required field. This would allow custom users fields to be editable once, but then once a value is saved, no longer be editable.

2 Likes