Second Form Updates Unwanted Fields

I’ve got a form to register users and a second form to update their profile except the password. So in the second form I deleted the password field but when I try to update somehow the password changes in the database.

In my update.php I have this. _form3 is my second form


<?php $this->renderPartial('_form3', array('model'=>$model)); ?>

It loads the new form without the password field and it allows me to update even with my password set as required in the model, but as I said, the password in the datebase changes somehow.


I checked again to see what’s wrong. If I don’t use any hash for the password it doesn’t change but if is hashed onBeforeSave() it will hash the actual password everytime I update. So this is what I have to solve because my idea was creating a new update form to avoid playing with the password everytime an update is needed.

Any idea?

Thanks

Hi,

I think you can set condition like update only on create … using rules method

array(‘user_password’, ‘safe’,‘on’=>‘insert’),

If it works give +1

No, it doesn’t work.