Modify User data before saving them with onUserBeforeSave - Joomla! Forum - community, help and support
hi !
i need plugin. need create manualy content of field "name" in registration form. point copy content of other field, email or anything... problem when test it's not working :
i tried put die; see if goes function , yes is. tried print_r($result); after part in user.php model :
and have "name" data, after store function doesn't replace old 1 new 1 in db...
i hope knows how deal this. global question be, "how modify field content before saving them" ?
thanks lot !
i need plugin. need create manualy content of field "name" in registration form. point copy content of other field, email or anything... problem when test it's not working :
code: select all
function onuserbeforesave($user, $isnew, $new) {
$user['name'] = "this_is_a_test";
}i tried put die; see if goes function , yes is. tried print_r($result); after part in user.php model :
code: select all
$result = $dispatcher->trigger('onuserbeforesave', array($old, false, $table->getproperties()));
print_r($result);and have "name" data, after store function doesn't replace old 1 new 1 in db...
i hope knows how deal this. global question be, "how modify field content before saving them" ?
thanks lot !
hi, have found answer question? trying in profile plugin.
but new data not getting saved, ideas?
code: select all
function onuserbeforesave($olddata, $isnew, $newdata)
{
$olddata["name"] = 'changed_name';$newdata["name"] = 'changed_name';
echo'<pre>';var_dump($olddata);exit;
return true;
}but new data not getting saved, ideas?
Comments
Post a Comment