Lines 302-308 of rules_views.module delete any roles created for the temporary user. Unfortunately, they also delete any roles automatically assigned to new users, through modules such as Auto Assign Role (http://drupal.org/project/autoassignrole).

Presumably, this will become a non-issue once the generic periodic execution is completed. In the meantime though, this could cause some damage.

I fixed the problem on my site by changing line 303 from
if ($rid > DRUPAL_AUTHENTICATED_RID) {
to
if ($rid > 5) {

The number in the second example should be changed to the last rid of any roles you want to keep. And obviously, this won't work at all for sites where user roles are more dynamic than on my site. I only have five roles (including authenticated), so this works for me.

Comments

steven jones’s picture

That's a pretty big bug, sorry if it caused you any trouble.

steven jones’s picture

Status: Active » Fixed

Fixed in CVS.

planstoprosper’s picture

No worries, the site's not production yet, so the only trouble was having to scratch my head for awhile figuring out where the role went!

Status: Fixed » Closed (fixed)

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