Closed (won't fix)
Project:
Role Expire
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Jul 2010 at 00:27 UTC
Updated:
9 Jan 2018 at 19:38 UTC
Jump to comment: Most recent
I'm creating a subscriptions website and using the AAR project to offer the user two roles on registration (one with a 30 day expiry attached)
http://drupal.org/project/autoassignrole
It seems that the expiry date is not being set during registration as expected
Similar to this issue (I think):
Role expiration isn't set during admin user add/create, only during edit.
http://drupal.org/node/608312
Comments
Comment #1
stewsnoozeThis is potentially quite simple. What is the weight of the AAR module in relation to Role Expire. I think AAR should probably be of a lower weight so that it runs first in hook_user() Can you try that before I dig into the AAR code?
Comment #2
Bobuido commentedHi stewsnooze
Thanks for such a quick reply
Unfortunately changing the weights of the modules didn't seem to help
I set AAR to -5 and Role Expire to 5 and still no joy - There's nothing I have to flush for the weights to take effect right?
The role is assigned but an expiry date is not set (only when I remove and re-apply the role)
Comment #3
natoya commentedHi!
Thanks for this amazing module.
I'm also having the same problem, when the role is assigned by the AutoAssign role module, the register in the DB is not added. How can we solve this?
Regards,
Natalia
Comment #4
tjb74 commentedsubscribing
Comment #5
jalane81 commentedSame problem here. Any luck solving this yet?
Comment #6
stewsnoozeI *think* this might be because role_expire doesn't have a case: 'register'
Does anyone have this combination installed before I spin up a new install to debug?
Can you try creating a user as an administrator, which will call case: 'insert' and see whether the role gets an expiry date. That will basically prove to me that role expire is missing case: 'register' which should be a simple fix
Comment #7
jenniferannwalsh commentedHi Stewart,
I just tested this out on a site with both role expire and auto assign role. I created a new user using the admin interface. I left the role expiration field that appeared blank. The new user was created with the default role expiration.
I too am attempting to create a user registration page with auto assign role that assigns a particular role with the default role expiration. Roles are getting assigned fine but with no expiration.
Tried creating a rule to assign the expiration after the fact but have not gotten that to work yet.
Happy to help test.
Jen
Comment #8
jenniferannwalsh commentedJust changing the status. Hope I got it right!
Comment #9
stewsnoozeOk that proves it. We should add the register case to role_expire_user. I'm not sure whether it can just piggy back on insert: and update: or whether it needs separate code
Comment #10
jenniferannwalsh commentedGlad I could do something to help. Wish I could help with code but I'm only good for testing. I'll stay tuned to this thread for requests to test.
Comment #11
jenniferannwalsh commentedOne other thing I noticed from a previous issue is that if a role is applied to an existing user by Rules the default expiration is not set. This was easy to remedy by adding another 'Do' to the rule to add the role expiration. Not sure if this is related or not but thought it was worth mentioning.
Comment #12
cham74 commentedsubscribing...
Comment #13
cham74 commentedHas any work around for this been made? We have several sites where we are creating several roles and need this function on sign up. We are having to manually remove the role and reapply it on the day of sign up, or manually edit the profile page of each new subscriber.
Comment #14
agalvez commentedI have the same problem too.
Comment #15
ReneHansenM commentedSame problem here.
Any news, this issue seems to have been around for a while? No posts since January either.
We have tried different approaches to get a role with expire date set on user self registration:
Using Registration role module. Role is set ok, but no default expire date.
Using Auto Assign Role module as described above. Role is set ok, but still no default expire date.
Setting up rules to assign the role AND setting the expire date. Role is set ok, but still no expire date.
The same problem using UC recurring fees to assign roles. Role is set ok, but still no default expire date.
Otherwise Role Expire is a very useful module, thank you for that. We are even using this patch, http://drupal.org/node/827594 #5, though it has not been committed as yet. It works like a charm.
Its sad though that Role Expire needs so much manual intervention to get the expire date set correctly.
René
Comment #16
stewsnoozeI have a week off next week. I'll take a look then. is that ok?
Comment #17
ReneHansenM commentedThat will be super.
Thanks a lot.
René
Comment #18
ReneHansenM commentedHi again Stewart,
I actually found a workaround, at least for the assigning of a 30 day trail membership to new users.
Instead of using the earlier mentioned role assign modules I simply make a rule as follow:
Rule:
__New User 30 Days.
Rule elements:
__ON event User account has been created
__DO
____Add user role
______User whos roles should be changed: registered user
______Select role(s): 30 days trail
______Weight: 0
____Add expire time to role
______The user which the expiration time will be added: registered user
______Role: 30 days trail
______Expiration time: 30 days
______Weight: 5
If you use acting user instead of registered user it won't work.
This is of cause not an optimal solution as its not the default expire time already set on the role which is assigned, which is also easier maintainable, but it works and will spare us lots of work correcting the expire date on every new user.
Now I just need to figure out if I can make similar rules setup for UC events. UC recurring fees module already has build in revoke and assign roles, but its not working with Role Expire as said earlier. Also the e-mail on, about to expire, is not a function in UC recurring fees, but that function we have very neatly in Role Expire, due to the patch mentioned earlier, which is why we need Role Expire.
René
Comment #19
sharplesa commentedI've just posted a patch over at #649256: Default expiration when creating new users - http://drupal.org/node/649256#comment-5291110. Does the new behavior from the patch over there simplify this? Please test and comment here.
Comment #20
rcodinaDrupal 6 version is unsupported!