Replacement for uc_roles


This is a new and improved version of uc_roles, with the functionality all ported to Drupal 6, and then some. I have started some experimental work on getting roles to renew in tandem with recuring payments, but this is not yet functional.

I would appreciate your testing and bug reports on this module, as it is a step forward in bringing UC to Drupal 6 compatibility.


* Much cleaning.
* Took the table creation in user account role expirations out of the code and created a theme function.
* Restructured the UI of the user account roles a bit.
* DB Access API. (caching to come)...
* Began phasing out the _role_action stuff ...
* Properly namespaced all the internal API.
* Replaced onclick with JS behaviors.


* Made the user account display of expirations functional again.
* Finished getting rid of _role_action.
* Major cleanups.


* Worked on a new function, uc_roles_order_renew() that will be able to renew expirations when uc_recurring is set to
use CA.
* Lots of API tightening, fleshed out the doxygen commenting... UI tweaks and improvements.
* Fixed a small bug on the user account page.
* Fixed form handling bugs I introduced into the expiration modification on the user account screen.


* Fixed a bug in the user account interface, where if you didn't modify any roles, it would complain that
the expiration date had already occured.
* Conditional Actions interface, don't set the desired order status to fire role updates anymore, specify
it in the CA admin interface. At trigger "Order status gets updated", predicate "Renew purchased roles".

P.S. I saw that stella was working on porting this module to Drupal 6, I hope I didn't step on any toes there. Smiling Not only did I port it but I did masive cleaning and API improvement, so hopefully everything's cool.

uc_roles.zip20.06 KB
LoveGolf's picture
Joined: 10/16/2008
Juice: 106
Re: Replacement for uc_roles

Did you happen to apply the bug fixes for the 5x version as well? Sounds exciting!

cha0s's picture
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Replacement for uc_roles

No, I haven't backported to Drupal 5. I know that some of the nice things I added were things that are new to Drupal 6 that make life easier for the developers...

If I'm directed to do that, I will, but as of right now I got other stuff going on...

btw, small bug fix on the module... first post updated Smiling

mikeryan's picture
Joined: 09/12/2008
Juice: 27
Status of this version?

How does this version of uc_roles relate to the one in bzr? Is this the only one under active development, or is that also receiving attention? If this one isn't under version control, how can I submit patches - attach diffs here?

I'd like to implement a hook for UC Roles: Expiration on a fixed date, I'd like to be clear on what version to work with and where to submit.


Lyle's picture
Joined: 08/07/2007
Juice: -40968
Re: Status of this version?

At this point, this version and the version in the Drupal 6 bzr branch are the same. I've tested out the basic functionality and it works so I committed it. I would suggest creating issues on and posting patches to those.

mikeryan's picture
Joined: 09/12/2008
Juice: 27
Re: Re: Status of this version?

Great, thanks!

karsten29's picture
Joined: 05/14/2009
Juice: 44
Re: Replacement for uc_roles

Do you happen to know where we can download the original version of uc_roles (for Drupal 5.x/Ubercart 1.x) ?

Any info would be greatly appreciated. Thanks.