Manipulating the data variable in hooks
Posted: 2013-10-25 19:04
I have a table in which the Detail View hides two of the fields from the user. However, I need specific information to be inserted into those fields when the user inserts a record. How do I add two more variables to the data array before the insert using the hook?
I tried this:
It doesn't work. Those two fields (userid, site) stay empty.
What is the correct way to add additional keys to the data array?
What is the correct way to change the data of keys stored the data array?
I tried this:
Code: Select all
function userinputtable_before_insert(&$data, $memberInfo, &$args)
$uid = $memberInfo['username'];
$data['userid'] = $uid;
$data['site'] = 'RGN';
return TRUE;
}
What is the correct way to add additional keys to the data array?
What is the correct way to change the data of keys stored the data array?