Closed (fixed)
Project:
Subscriptions
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Sep 2012 at 09:03 UTC
Updated:
29 Sep 2012 at 11:21 UTC
Hello,
I have a "premium" role on my website and I have assigned to subscriptions to be auto-enabled when a user gets that role. The problem is that when that role is revoked subscriptions are keep sending to those people. I was trying through Rules to add a trigger and an action to remove subscriptions when the premium role is revoked but i assume this is not currently supported since i didn't see anything related with subscriptions there.
Is there a workaround? or does this feature already exists and I am missing something?
Thank you for your time
Comments
Comment #1
salvisI don't think that works as you expect. Those subscriptions are assigned only if a new user is created with the corresponding role. If the role is assigned later, then nothing happens, I think.
The problem with adding/removing subscriptions to an existing user is that you don't know what changes the user has made manually. If you re-add a subscription that the user has removed, or you remove one that the user has manually added, s/he won't like it.
At this point we have no Rules integration, but you are welcome to post a patch.
Comment #2
arekanderu commentedThank you for your reply salvis.
I will probably write a small module to handle this and remove the subscriptions from non-premium users.
Comment #3
salvisYes, that makes sense.
Comment #4
salvisComment #5
arekanderu commentedOne more question though; Can you please point me out a function (if any) in the subscriptions module which will remove all subscriptions from a user or maybe some module helper methods i could use?
Comment #6
salvisWe didn't have a function for that, but there should be one.
I just created subscriptions_delete($recipient_uid, ...) and pushed it to the -dev version. Give it up to 12h to be repackaged.
Comment #7
arekanderu commentedThanks a lot salvis. I'll try it out and give you some feedback
Comment #8
salvisYes, please do.
Comment #9
arekanderu commentedsalvis, function works as expected, thanks again.
Comment #10
salvisGreat, thanks!
Comment #11
arekanderu commentedI was just checking that and you are right. If the role is assigned later, then indeed nothing happens. (Just wanted to confirm it) I guess...I need to write a little more code cause if the role is assigned later i want the user to have their subscriptions enabled.
Thanks for the help
Comment #12.0
(not verified) commentedgrammar error