Skip to content
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

Merged
merged 3 commits into from
Mar 14, 2017

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Feb 27, 2017

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.

@tvdeyen tvdeyen requested a review from Senjai February 27, 2017 13:38
@tvdeyen
Copy link
Member Author

tvdeyen commented Feb 27, 2017

@Senjai you introduced the fix in 72f8a0c
Could you please review?

@tvdeyen
Copy link
Member Author

tvdeyen commented Feb 27, 2017

This also needs to be backported to v1.4 as this bug is also present in 1.4.0

@tvdeyen tvdeyen self-assigned this Feb 27, 2017
@tvdeyen
Copy link
Member Author

tvdeyen commented Feb 27, 2017

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

@tvdeyen tvdeyen added the WIP label Feb 27, 2017
@tvdeyen tvdeyen requested review from Senjai and removed request for Senjai February 27, 2017 13:45
@tvdeyen tvdeyen removed their assignment Feb 27, 2017
@tvdeyen
Copy link
Member Author

tvdeyen commented Feb 27, 2017

@Senjai done

Copy link
Contributor

@jhawthorn jhawthorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Senjai
Copy link
Contributor

Senjai commented Feb 28, 2017

@tvdeyen lgtm, thanks.

@tvdeyen
Copy link
Member Author

tvdeyen commented Mar 10, 2017

Oh. Thanks John. Let me rebase this.

tvdeyen and others added 3 commits March 10, 2017 10:32
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.
@tvdeyen tvdeyen force-pushed the fix-admin-users-role-update branch from 1f118a1 to 56866ed Compare March 10, 2017 09:33
@tvdeyen
Copy link
Member Author

tvdeyen commented Mar 10, 2017

@jhawthorn rebased

@jhawthorn jhawthorn merged commit 5ef6d84 into solidusio:master Mar 14, 2017
@tvdeyen tvdeyen deleted the fix-admin-users-role-update branch March 14, 2017 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants