Roles are not assigned after registration

mariusooms - March 18, 2008 - 10:27
Project:Auto Assign Role
Version:5.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:cyberswat
Status:fixed
Description

Hi, I'm using the option "User Role Assignment" where the user can select between four roles. Roles exist and show up at the registartion form. However the role is not assigned. I'm not sure what is interfering. I'm not doing anything special. I have 'Usernode' and 'Captcha' installed, I assume they don't have anything to do with it. How can I troubleshoot this? I have tried some other role assignment modules as alternatives, but really prefer this module if I can get it to work.

Thanks in advance for helping out.

Marius

#1

lauscherli - March 20, 2008 - 16:42

I have the same problem. The choosing-role-buttons show up at registration, but after registration users only get the permissions of 'authenticated users', but not the rights of the specific role they assigned themselves when registering, and so also the badges for that specific roles don't show up (using advprofile).
Would be really nice... I know you are busy and look for co-maintainers...- but you don't want to have me code... I'll check DROP instead.

I'd be willing to pay a little bounty (50-100 USD) for this, as i only noticed this after i tried to go life (and lots of work i did before depends on this feature). Thank you.

#2

jefftrnr - March 20, 2008 - 17:14
Status:active» patch (code needs review)

User Role Assignment Patch.
I think my patch fixes this role assignment issue.

The problem seemed to be with the way it sorts the role array in the form_alter hook. PHP multisort unassigned the key, making the values of the roles incorrect. I've replaced both function calls with asort and arsort. I've also removed the assignment selector from the register page if the user has user_access 'administer access control'. That way , when the admin user adds a user, he/she can simply select the role without having to select the autoassign role as well.

This is my very first durpal patch! (woo hoo!) but, I've test it and the changes are pretty small. I'm a bit unfamiliar with diff output formats, so please let me know if the patch needs adjustments. Hopefully it's done correctly.

AttachmentSize
autoassignrole-235707-1.patch776 bytes

#3

ladylolauren - March 20, 2008 - 17:17

This patch is great...and much needed for my project! Thanks for taking care of this ;)

#4

mariusooms - March 20, 2008 - 19:19

Thanks for patching this up...I will test in the coming days...most likely I won't need it anymore :) as I just started to migrate to Drupal 6. Any change this module will see the light of day on that version of Drupal?

Thanks a ton,

Marius

#5

lauscherli - March 22, 2008 - 13:03

cool! i'm just going to try this out. if it works 4 me, contact me 4 the bounty (i promised), or i donate it to the drup-association.

-- It works :) ! Only drawback is that the user-badgets don't react propperly on it. I need to help them manually by resaving the badget-roles.

#6

andypost - March 24, 2008 - 14:04

Cumulative patch and 6юч migration http://drupal.org/node/228774#comment-781025 supersedes this one.

#7

GiorgosK - April 9, 2008 - 23:44

I could not apply this patch with windows patch.exe

I was actually able to apply this patch though
http://drupal.org/node/228774#comment-791990

and it seems to be working

I don't really know what their difference is

#8

reed.richards - April 15, 2008 - 17:14

Patch at 2# works but you have to do it manually or at least it doesn't work with Cygwin instead it messes up stuff badly.

#9

30equals - April 17, 2008 - 21:01

hi reed.richards

could you possibly quickly explain how to change it manually ?
i've tried to, but i must be doing something wrong... though there isn't that much code to be altered.

thanx!

#10

xxm - April 21, 2008 - 21:02

I've patched it but still the user is not directed to the chosen role. Did you only patch the autoasign.module or anything else?

#11

reed.richards - May 10, 2008 - 16:33

I just opened up the patch file and tried to localize the corresponding lines in the module. It was a bit tricky because some lines were not on the exact number.

I am adding my patched module file below, but I am not taking any responsibility for it. Do a backup before if you overwrite with my file.

AttachmentSize
autoassignrole.zip1.98 KB

#12

MissyM - May 30, 2008 - 19:00

Your patched mod worked for me.

#13

menoseficaz - July 1, 2008 - 02:47

#11 Patch worked for me too - like a gem! Thanks reed!

#14

karlblau - August 8, 2008 - 20:33

Great!! it worked for me 2!!

#15

richygecko - August 16, 2008 - 05:13

yep #11 worked for me too.

#16

cyberswat - August 24, 2008 - 07:11
Assigned to:Anonymous» cyberswat
Status:patch (code needs review)» fixed

new release coming out soon check dev snapshot for working code

 
 

Drupal is a registered trademark of Dries Buytaert.