-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Do not clear roles when no role params are present #1747
Do not clear roles when no role params are present #1747
Conversation
This also needs to be backported to v1.4 as this bug is also present in 1.4.0 |
Just saw that we need a fix for the missing "empty role ids param" in the users form and feature spec. Let me add this as well |
@Senjai done |
01b60d0
to
d88864c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@tvdeyen lgtm, thanks. |
Oh. Thanks John. Let me rebase this. |
There is a regression where updating a user in the admin without spree role ids in the params causes the current user roles being wiped out. Also fixed a spec that only passed because of this bug being present.
In HTML unchecked checkboxes won’t get submitted in a form. That’s why Rails’ `check_box` helper always sets a hidden field with the same name. This field will be submitted when the checkbox is not checked and will be ignored when the checkbox is set. As we don’t use Rails’s `check_box` helper but `check_box_tag` helper in the admin users form role checkboxes we need to add this hidden field ourselves.
1f118a1
to
56866ed
Compare
@jhawthorn rebased |
There is a regression where updating a user in the admin without spree role ids in the params causes the current user roles being wiped out.
Also fixed a spec that only passed because of this bug being present.