I have a really simple part of code acting in a really strange way: In a controller where i’am performing an update i have:
$model->attributes = $_POST['Critique'];
echo $model->id_user;// My new id_user (eg: 5)
$success = true;
if(!$model->validate()){
$success = false;
}
echo $model->id_user;// The old id_user (eg: 1)
So as you can see the $model->validate() is changing the value of id_user, setting back the old value even if I have no error during the validation process.