1. thefbi
  2. Support
  3. Thursday, July 01 2021, 04:15 PM
Hello,
i have a little problem. I have a component (OS Service Booking) that link the name field of the registration form to the core name field of Joomla.

The problem is in Easyprofile, i can choose if i want to use Firstname + Lastname or only Name.
But if i choose only name, it is not the name field but the firstname field used.

So, when i register with OSB, the firstname field is empty in my user profile page. I dont have "name" field.
Is there a way to "say" to the firstname field of Easyprofil to "get" the content of name field of Joomla ?

(Joomla 3.9.27)
thefbi Accepted Answer
Hello, little up on this problem please ...
  1. more than a month ago
  2. Support
  3. # 1
admin Accepted Answer
Admin
Hi and sorry for late reply,
So, when i register with OSB, the firstname field is empty in my user profile page. I dont have "name" field.
Is there a way to "say" to the firstname field of Easyprofil to "get" the content of name field of Joomla ?
Unfortunately this is not possible natively, anyway you can manage this with a simple plugin:
- Download, Install and Enable Skeleton Plugin (you will find it at http://docs.easy-profile.com/index.php/article/triggers)
- Open file /plugins/jsn/skeleton/skeleton.php
- remove samples functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- add function like this:
public function triggerProfileUpdate($user,&$data,$changed,$isNew){ 
if(empty($data['firstname'])) $data['firstname'] = $user->name;
}
  1. more than a month ago
  2. Support
  3. # 2
thefbi Accepted Answer
Hi, great !
Thank you very much. I will try it and come back post the result.
Regards
  1. more than a month ago
  2. Support
  3. # 3
thefbi Accepted Answer
Just a question, is normal you have put a & before $data ?
  1. more than a month ago
  2. Support
  3. # 4
admin Accepted Answer
Admin
Hi,
yes, because $data var is passed by reference (not by value), this is useful if you want to change values that will be stored, for example
$data['sum_field'] = $data['operator1'] + $data['operator2'];
  1. more than a month ago
  2. Support
  3. # 5
thefbi Accepted Answer
OK, thank you.
  1. more than a month ago
  2. Support
  3. # 6
thefbi Accepted Answer
Hello,
sorry for late reply, but it dosent work.

Have i to use the alias of JSN field or the name ?
  1. more than a month ago
  2. Support
  3. # 7
admin Accepted Answer
Admin
The correct is the alias of the field
  1. more than a month ago
  2. Support
  3. # 8
thefbi Accepted Answer
OK, so the code is right, but that not fill the field.
Is there anything else to do with the plugin to make it work (apart from publishing it of course) ?
  1. more than a month ago
  2. Support
  3. # 9
thefbi Accepted Answer
I join some screenshots for understanding.
  1. more than a month ago
  2. Support
  3. # 10
admin Accepted Answer
Admin
Hi,
sorry for late reply, we are thinking about this issue. Why all other Easy Profile fields are filled? unfortunately we does not have experience with OS Service Booking, so for us a bit difficult to understand why it is empty.

Also, it's possible for you to provide to us your site details (a staging site is better). If yes then you can use the form below the reply in "Site Details" tab
  1. more than a month ago
  2. Support
  3. # 11
thefbi Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 12
admin Accepted Answer
Admin
Thanks for your availability, we are waiting news from you :)
  1. more than a month ago
  2. Support
  3. # 13
thefbi Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 14
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.