-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.6.0 breaks activeadmin forms that have password
field
#5033
Comments
In case it helps others, I am using this workaround in the activeadmin pages that have an editable devise password field:
|
This is occurring in our application as well. In our case, it's happening when trying to update a user record as a part of minitest framework test suite. Please fix. |
Same issue here. @gsar's monkey patch works. |
I have the same problem on my application. I want to update an account without changing the password but changing some other fields. I get a validation error: Parameters |
Broke for me too. Just add
|
@nosretep your solution breaks logins! If I submit an account form to update the account and leave |
@phlegx works for me on my specs, login seems to have not broken for me. I'll keep on the lookout though. |
|
This is affecting our application, unrelated to ActiveAdmin (we don't use it). We have a form that allows an account admin to change a user's password through the Specifically, this fails to update:
To work around this I've changed
This is clearly a breaking change and I can't see how this doesn't affect every application that has a password field on the |
Also experiencing this with a custom form. The patch on 4.6.0 was introduced for security from what I can tell so setting a password to blank would set the encrypted_password to nil because it was “expected” to do so and was a security risk not to. As encrypted password is NOT NULL column, this isn’t the expected behaviour and I doubt ever was. My understanding of the expected behaviour was that setting password to nil or blank would not update the users’ ability to access their account and was a common way for forms to not update the password field You can see a more relevant discussion on #5044 |
Hi everyone, sorry for the delay. The original change was meant to keep the attributes in sync ( We'll be releasing a patch version later today. Thanks again and sorry for all the trouble. |
Released in version |
Great works guys! |
Is that supposed to be sarcasm? (if yes, it isn't entirely clear. The internet is a very poor medium for sarcasm) In the open source world having upstream dependencies without carefully assessing updates can be very dangerous. Not to say that it isn't regrettable that you made a lot of changes because of that minor release. |
It's not a sarcasm man. Look around, it's real world not sarcasm. Good to known about next major version thanks. Because to do work twice is boring. |
I’m not a maintainer, so can’t say if the reason for the change was a real concern and if it will be addressed in the future. It was just mentioned in the PR to revert it that if this change did come back it would probably be part of a major release. Not a minor one. In the economics world it is called “sunk costs”. If you do work and it gets thrown away, the cost is already paid so no use worrying about it. |
@OpakAlex You're asking what do to now if you already included the monkey patch in your application? If that's the case, I'd advise to remove it and update when you can. I say "when you can" because this will depend on your context. It might be more important for you to finish a feature and do this later but it's important to update later. |
@NikoRoberts Yeah, that's correct. There are no guarantees that this will come back but if it does it will come in a major version and we'll do something to make the transition smoother, like emit deprecation warnings and write upgrade guides. |
@tegon maybe i am wrong, but fix application for gem version it's not monkey patch. |
Why you can not say, you did wrong merge? It's more easy, and everybody will understand, prev version was wrong. it's normal. |
@OpakAlex By monkey patch, I meant custom code to change a library behavior that better fits an application. I just looked up at the example and this case it wasn't needed to open any of the Devise's classes so I guess it's not monkey patch.
I believe I explained the reasoning behind this on a comment above. |
I know this issue is closed but I figured this might help some others that might encounter a problem we had. I'm not sure how our problem relates, but upgrading to the 4.6.2 release from 4.6.1 fixed it. We have a Thanks for all your good work! |
Rubocop recommends not nesting a sole nested conditional:
|
bro have you find the answer for that |
Environment
Current behavior
It appears that PR #4261 introduced a change where
encrypted_password
could be set tonil
even when no attempt was made to changepassword
. The relevant comment is here #4261 (comment)This results in user model forms that have a password field in activeadmin to break with a validation failure when the password field remains empty on submit:
Expected behavior
No attempt should be made to set
encrypted_password
tonil
if thepassword
field doesn't have a value. This was the case in devise versions prior to v4.6.0.The text was updated successfully, but these errors were encountered: