Skip to Content Skip to Menu

Custom order for Joomla users.name with First, Middle and Last Name fields

  • nesen
  • nesen
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
1 month 2 weeks ago #344154 by nesen
Hello,We are using:
  • Joomla 5
  • Community Builder 2.11
Our registration form uses the standard CB fields:
  • Code:
    firstname
  • Code:
    middlename
  • Code:
    lastname
For the names we need the format:
Code:
Lastname Firstname Middlename
We have configured:
Code:
Name Format = Custom Custom Name Format = [lastname] [firstname] [middlename]
This correctly affects
Code:
formatname
, but the Joomla user field
Code:
#__users.name
is still being saved as:
Code:
Firstname Middlename Lastname
Questions:
  1. Is there a supported way in CB 2.11 to save Joomla
    Code:
    users.name
    as:
    Code:
    [lastname] [firstname] [middlename]
    during registration and profile updates?
  2. Can
    Code:
    Custom Name Format
    be used to populate Joomla
    Code:
    users.name
    , or does it only affect
    Code:
    formatname
    ?
  3. Is there a CB Auto Actions or CB Code Field method recommended by CB to synchronize
    Code:
    #__users.name
    with a custom name format?
Thank you!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50620
  • Thanks: 8673
  • Karma: 1474
1 month 2 weeks ago #344155 by krileon

is still being saved as:

As the parameter suggestions it strictly controls the display format for the formatname field. It does not alter storage.

Is there a supported way in CB 2.11 to save Joomla users.name as: [lastname] [firstname] [middlename] during registration and profile updates?

No. That would result in a name that's out of order in storage so anything splitting the name would become incorrect.

Can Custom Name Format be used to populate Joomla users.name, or does it only affect formatname?

No. Why do you need to do this?

Is there a CB Auto Actions or CB Code Field method recommended by CB to synchronize #__users.name with a custom name format?

That's possible, but then you would immediately break the formatname field behavior. So I do not recommend doing so.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • nesen
  • nesen
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
1 month 2 weeks ago #344156 by nesen
Thank you for the clarification.The reason we need this is that several third-party Joomla extensions use the Joomla core field
Code:
#__users.name
for automatic data population and do not support CB
Code:
formatname
or custom CB fields.In our locale, the standard format for a full personal name is:
Code:
Lastname Firstname Middlename
For example:
Code:
Smith John Michael
Currently CB correctly displays this through
Code:
formatname
, but external Joomla extensions continue to use:
Code:
#__users.name
which is stored as:
Code:
John Michael Smith
Because of this, data is propagated to other components in an incorrect format.I understand that changing
Code:
#__users.name
is not recommended and may affect software that attempts to split the name into separate parts. However, in our implementation we already store:
  • firstname
  • middlename
  • lastname
as separate fields, and
Code:
#__users.name
is only used as a display value and as a source for third-party integrations.Could you recommend the best CB-supported method to synchronize
Code:
#__users.name
from existing CB fields during registration and profile updates?Thank you.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50620
  • Thanks: 8673
  • Karma: 1474
1 month 2 weeks ago #344157 by krileon
The separate fields are a backup for the name field. I do not recommend modifying the name field. At any rate if you want to do this you can do it with the below. As you've been warned about this already I'll leave it to you to decide risking your data.

Global
Triggers: onAfterUserRegistration, onAfterNewUser, onAfterUserUpdate, onAfterUpdateUser
Type: Field
User: Automatic
Access: Everybody
Action
Field: name
Operator: Set
Value: [formatname]

I would recommend exploring other ways to bring CBs name formatting to other extensions. Either with Joomla events in those extensions or possibly working with developers of those extensions to add Joomla events to allow for this or for them to have CB support built in.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • nesen
  • nesen
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
1 month 2 weeks ago #344158 by nesen

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum