Dont' know why but since Joomla 3.9.22 (or 3.9 ?), when I create a User with User Class, I have the error "Please enter your name". But the name field is not empty.
Here is my simple code :
$udata = array(
"name"=>$data['name'],
"username"=>$data['user'],
"password"=>$data['pass'],
"email"=>$data['email'],
"block"=>0,
"groups"=>array("1","2"),
"params"=>array(
"admin_style" => "",
"admin_language" => "",
"language" => 'fr-FR',
"editor" => "",
"helpsite" => "",
"timezone" => ""
),
"requireReset"=>1
);
$user = new User;
$user->save();
if(!$user->bind($udata)) {
return false;
}
Here is the User Object:
object(Joomla\CMS\User\User)[440]
protected 'isRoot' => null
public 'id' => int 0
public 'name' => string 'Test TEST' (length=9)
...
protected '_errors' =>
array (size=1)
0 => string 'Veuillez saisir votre nom.' (length=26)
Someone could help me? Because I don't understand.
Thanks,