I have problem to update user data in cakephp.
When I submit form I have this data in $this->data:
Array
(
[User] => Array
(
[first_name] => Dusan
[last_name] => Stojanovic
[native_language_id] => 25
)
)
but, when i try to update it with:
$this->User->id = $id;
$this->User->save($this->data)
model is not saved, because of validation. They try to validate field which don’t exist in $this->data array (like invalid password, email etc.). How I can fix this so I can update only fields that exist in $this->data array?
To properly do this you should set the validation rules’
onoption tocreateonly and/or setrequiretofalse.For a quickfix, supply a
$fieldlistof fields you want to save: