Hi there, I was experimenting with the role assignment feature yesterday. I have the roles "full membership" and "featured membership" set up as products. The full membership role has various options - 1 month, 3 months, 6 months, etc. I've set it up to do the role assignment on "Pending" so that I can test. This seems to work really well, aside from one thing. The problem is, this morning when I logged in, the role expiry for all users seems to have vanished. They still have the assigned roles, but no expiry dates. So it seems the role expiry dates that were assigned the previous day have been lost. Indeed, they don't appear to be listed in the uc_roles_expirations table.

When I login to a user that added roles yesterday and try to add a new membership, the order goes through but the role expiry table isn't updated.

When I create a new user and add a role, everything works fine.

Your attention to this issue would be much appreciated. Please let me know if you need further information.

Thanks,
Peter.

CommentFileSizeAuthor
#2 uc_roles.patch524 bytesShawn Conn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wotstheguts’s picture

Further information - cron seems to be causing this. I just ran cron manually, and the role expiry table was cleared.

Cheers,
Peter.

Shawn Conn’s picture

Assigned: Unassigned » Shawn Conn
Status: Active » Fixed
FileSize
524 bytes

Yeah, thanks for point this out this a pretty big bug. I've attached the patch file that you can use to fix the problem. I forgot that the user->roles array is a keyed array and not just a standard array with containing all the role ids for a user's roles. The fix has been committed and will be out in the next release.

wotstheguts’s picture

No worries, thanks for fixing it so quickly. Installed the patch and all good now.

Cheers,
Peter.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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