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

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 - 2 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" => "change@mymail.com",
"cuid" =>"toto_tata" 
   );
$userobj = \eZUser::fetch(45874);
$user=\eZContentObject::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);
\eZContentCacheManager::clearObjectViewCache(45874);

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?

Thanks

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.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from