I'm using Drupal 7.7 with the MySQL 5.1.53-log database, PHP 5.2.17, and Apache web server.

I've disabled all non-Core modules except for Chaos Tools, Date, Feeds, Localization update, Language icons, Organic Groups, Entity API, Entity Tokens, Job Scheduler, Libraries, Token, Panels, Rules, and Views.

I've installed Registration Codes and Role Assignments.

I created a registration code taxonomy term "Teacher". Then, under the Role tab, created a rule where a user registers with a code tagged with "Teacher" is assigned the user role (also named) "Teacher".

I then generated a registration code and tested it out.

The user is created as normal, but the Teacher role is never assigned.

If I enable LoginToboggan or Realname Registration or change the registration process to require verification, nothing changes. The role is never assigned.

I disabled/uninstalled/deleted Registration Codes 7.x-1.0-beta2 and tried the latest dev version. Nothing has changed.

Also, in addition to the role assignments not working, I cannot delete any role assignments I create.

Can someone reproduce this or is this some conflict that is specific to my setup?

Comments

vertuli’s picture

Priority: Normal » Major

I've just repeated this bug on a fresh test install of Drupal 7.8 with Views + CTools installed and Registration Codes + Role Assignment.

Went to admin/config/people/accounts and allowed visitors to register without administrator approval.

Created a new user role "teacher". Did not modify any permissions.

Created a new registration code taxonomy term "teacher".

Created a new registration code with the following properties:
Registration Code: TR
Maximum Uses: 0
Active From and Expires On were left blank
Tags: checked "teacher"
Under Bulk Creation, left the default values of 1 code and code size 10 and letters format, with uppercase unchecked.
Created the code.

Under the Roles tab, created a new rule where the role "teacher" is assigned when a user uses a regcode with tag "teacher".

In a separate browser, created an account using the registration code "TR". No role assigned. After using the one-time login link, no role assigned still.

Also, while trying to delete the rule, I'm given a message "Rule was deleted (Rule #delete)" but the rule does not delete.

I'm new to the Drupal community, so correct me if I'm wrong for doing so, but I feel the priority should be changed to Major since this seems like failure of a key component fresh-out-of-the-box.

znerol’s picture

Thanks for your detailed report. I was able to reproduce the behaviour and also found the culprit. Attached are two patches fixing the two problems.

vertuli’s picture

Status: Active » Reviewed & tested by the community

I've applied both patches and it's working great! Thanks for the very quick fix.

aidanlis’s picture

Status: Reviewed & tested by the community » Fixed

Thanks znerol!!!

Status: Fixed » Closed (fixed)

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

p1nr’s picture

Still not working for me :( why?!?!?!
I've commented out the implements hook form FROM ID alter code on the regcode_module file so that users wont have to see it but everything works fine except this damn auto role... pls help this is frustrating me!!!!