I'm receiving the error "Please select a role." when trying to update a user's profile after enabling the Apply for role module. If I disable the module the error disappears when updating a profile. I've tried both version 6.x-1.7 and 6.x-1.x-dev and the bug appears in both versions. I also noticed that the checkbox for "authenticated user" is checked but disabled the first time the page loads but after trying to save the page the checkbox is still disabled but not checked. I'm using Firefox 3.0.4 in case it helps with the troubleshooting.

CommentFileSizeAuthor
#1 user_update_error_fix.patch528 bytesd.clarke

Comments

d.clarke’s picture

StatusFileSize
new528 bytes

I took a look at the code where it was erroring and I was able to get a work around in place so I'm including it as a patch. I'm not sure though if my patch is the proper Drupal way to do things so I'd appreciate it if someone could review it. To recreate the issue:
1. Make sure that the role selection is required during registration
2. Create a new user assigned to a role
3. Log in as the new user and try to edit their profile

d.clarke’s picture

Status: Active » Needs review

Updating status... forgot to update on last post

d.clarke’s picture

Status: Needs review » Closed (fixed)

After looking into this issue some more it appears that when applying for roles is made mandatory when a user tries to update their user's profile if they don't check another previously unselected role then it displays the "Please select a role." validation message. I'll look in to this more later but for now this proposed patch can be ignored.

Soren Jones’s picture

Status: Closed (fixed) » Fixed

beday00,

Thank you for reporting this and for your persistence! This was a significant bug. And you were right about where it was. Validate was being used incorrectly.

Soren

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.