Hello,We are using
Community Builder with CB Auto Actions 9.5.0 and would like to automatically generate an opaque public profile alias for every newly registered user.The goal is to have profile URLs such as:
Code:
/member-a7c29f81d4.html
instead of exposing the Joomla username in the profile URL.We created a CB Auto Action with the following configuration:
- Trigger:
Code:
onBeforeUserRegistration
- Action type: Field
- Field: Alias
- Operator: Set (field = value)
- Value:
Code:
[cb:parse function="code"]return 'member-' . bin2hex(random_bytes(5));[/cb:parse]
- Save directly: No
- User: empty (triggering user)
- Format Code Function: enabled
- Reference Variable: Variable 1 (
)
- Display: No
The PHP format function itself should return a value such as
, but after registration the user's
Alias field is still empty.We also tested without using the Reference Variable, with the same result.Could you please advise what the supported way is to populate the built-in
Alias / Profile URL field automatically during CB registration?In particular:
- Is
Code:
onBeforeUserRegistration
the correct trigger for this?
- Can the Field action modify the built-in
field at this stage?
- Should Save directly be enabled or disabled?
- Which Reference Variable, if any, should be used?
- Is there a different CB trigger specifically intended for setting the profile alias before the user is stored?
Our objective is simply to generate a unique, non-personal, non-guessable profile URL automatically for each new account.Thank you.