This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Developer » updating user attributs not working...

updating user attributs not working after the first call

updating user attributs not working after the first call

Thursday 27 July 2017 6:36:35 pm - 3 replies

Hello , 

i have a big problem about updating user information ,

i have an array of information like :

$data = array(    
"last_name" => "toto",
    "first_name" => "tata",  
  "email" => "",
"cuid" =>"toto_tata" 
$userobj = \eZUser::fetch(45874);
$userAccountStatus= $userobj->isEnabled();
$newdata['user_account']= $data['cuid'] . '|' . $data['email'] . '|' . $userobj->passwordHash . '|' .
\eZUser::passwordHashTypeName(\eZUser::hashType()) . '|' . $userAccountStatus;
$updateData= array('attributes'=>$newdata);
\eZContentFunctions::updateAndPublishObject($user, $updateData);

the first time , this code can update my user attributs  , but if i call it agin for the second time , i can't work . 

there is any suggestion for that ? i really don't understand what is happened here ? 

Modified on Thursday 27 July 2017 6:55:09 pm by Adil Kabbali

Saturday 29 July 2017 10:20:28 am

Hello Adil, welcome on our forum. Can you share which version of eZ you are developing on?


Monday 07 August 2017 11:56:32 am

Hello Adid, 

Did you find the answer ?

I think you have to make sure you're trying to update the current version of the object. 

Let me know.

Thursday 12 October 2017 3:44:02 pm

ezpublish 4.7 . 

i find the solution o that . thank you 


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from