Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: [SOLVED] First and last name field not automatically filled

[SOLVED] First and last name field not automatically filled 14 years 9 months ago #6865

  • internetty66
  • internetty66's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 51
  • Thank you received: 0
I just completed the setup of DT Register 2.6.3 on a Joomla installation 1.1.15 with Jomsocial 1.6

When trying to register for an event as a registered user, I can see that the first and last name field is not prefilled....while all the others are (address, city, country, phone).

The user profile integration JomSocial is enabled on first tab in configuration and on tab JomSocial I have linked the fields DT Register with JomSocial - but I do not have the fields first name and last name listed here.


In my case I have Community Builder and JomSocial installed - because I have imported from an old CommunityBuilder Joomla installation the user data into
a new Joomla installation which will be the relaunch of the old page but with JomSocial. The idea is to de-install CB later on.

What I found out:
===============
In the jos_comprofiler table (Community Builder) there are the fields "firstname" and "lastname" which are predefined system fields in Community Builder - while in the standard Joomla user table jos_users there is just the field "name".

When you have JomSocial installed, then there is just one table for the custom fields which is jos_community_fields.
While JomSocial is referencing the jos_users table in case of username, name and email.

But there is no first and last name....this is predefined in Community Builder only.

Therefore if I fill the fields "first name" and "last name" in Community Builder, I have the corresponding fields prefilled/populated on the DT register form.
But if the fields are blank in CB, they are blank in the DT Register form also.

For me it clearly means, that altough JomSocial is activated in DTRegister, the data in case of first name and last name comes from Community Builder.

But what happens, if I de-install CB ? Unfortunately I cannot test this at this stage as I am still in the developing phase before the new site can be relaunched.
But I will definetely stop using CB.....

What happens then ? I cannot maintain data in two systems.

May I kindly ask you to investigate this please

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

Last Edit: by internetty66.

[SOLVED] First and last name field not automatically filled 14 years 9 months ago #7000

  • internetty66
  • internetty66's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 51
  • Thank you received: 0
The issue seems to be solved now:

Got help via support ticket:

To apply the fix, open this file:

/components/com_dtregister/class.dtregister.php

Around line 523 add this:

$query = "select * from #__users where id= ".$my->id ;
$this->db->setQuery($query);
$user_data = $this->db->loadObject();
$data = explode(" ",$user_data->name );
$object->firstname = $data[0];
$object->lastname = (count($data)>1)?end($data):'';

This will be at the very end of:
function loadJomsocial(&$object = null){

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

  • Page:
  • 1
Time to create page: 0.086 seconds