2

I'm trying to modify user using following code.

$queryUsers = new ParseQuery("_User");
$queryUsers->equalTo("objectId", $userId);        
$resultsUsers = $queryUsers->find();  
$updateUsers = $queryUsers->first(); 
$updateUsers->set("status", $status);                        
$updateUsers->save();     

But parse SDK returning following error.

An uncaught Exception was encountered

Type: Parse\ParseException

Message: Cannot modify user n7ZERX6Fls.

Filename: /var/www/html/mementuum_admin/application/third_party/parse-php-sdk-master/src/Parse/ParseClient.php

I have modified several other tables but not able to modify user table in parse.

Please Help.

Muz
  • 5,866
  • 3
  • 47
  • 65
Tush
  • 189
  • 1
  • 10
  • Sometimes it's an issues with the sessions. You can try clearing the sessions associated with the user. It could also be something like the wrong masterkey but I suspect you wouldn't be able to pull data at all if that were the case. – Muz Mar 02 '17 at 08:14
  • Thanks for your comment. I have clear the session of this user but not working. – Tush Mar 02 '17 at 08:50

1 Answers1

5

Finally I got the answer.

Just we need to add 'true' in save function.

Code should be following

$updateUsers->save(true);

Instead of

 $updateUsers->save();
Tush
  • 189
  • 1
  • 10