Closed (outdated)
Project:
Profile 2
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2017 at 15:01 UTC
Updated:
16 Oct 2018 at 15:17 UTC
Jump to comment: Most recent
I have two different profile2 type those are 'main' and 'nilaiku' and have a couple of fields inside of each profile2 type i want to every i update field in 'main' type will automatically generate or change the value of field in 'nilaiku' prfofile2 type ?? i have some code but not work !
function formid_profile2_update($profile) {
global $user; //is the current user
$profile = profile2_load_by_user($user->uid, $type_name = 'nilaiku');
$profile ->field_uas[LANGUAGE_NONE][0]['value'] = 4447;
//drupal_set_message ($user->uid);
field_attach_update('profile2', $profile);
}
it will be working fine if we put specific uid in profile2_load_by_user() into first parameter but thats not what i need.
thanks in advance :)
Comments
Comment #2
rickj commented