It'd be nice for subscription based sites to be able to set a time for the subscription to expire, with OG Membership Expiration if that module is enabled.

Comments

tinker’s picture

Assigned: mikey_p » tinker
Status: Active » Needs work
StatusFileSize
new11.65 KB

I had this working on a site a while back. Hopefully everything is in the patch but I am posting this as "needs work" because I have not tested this patch. This patch modifies the "uc_og_subscribe" table using an update. I don't know if this will work without a version number change so please compare the table and schema after update but before testing.

Please note that this feature requires a patch to og_expire so that anonymous Conditional Actions can set the expiration using og_expire_set_cron(). See #673988: API Function og_expire_set() shouldn't have access check.

jhrizz’s picture

StatusFileSize
new33.95 KB

Howdy!

Patch took with no problem, however I did have to manually create the database tables.

My concern is that, even though I have the defaults set in "Organic Groups / Expiration dates" when I add a user to a group, they still get an expiration date of "never".

I am able to click "change" and THEN have the default expiration offset take- Perfect!

I am looking to use "Ubercart Organic Group Subscribe" in conjunction with "OG Membership Expiration" in an automated sense, IE:

1) User purchases product with feature: Group Subscription
2) User is added to group
3) **OG Expire offset is applied as per the product feature
4) The rest works perfectly...

I have successfully applied the following patches. Note- I did NOT apply the code cleanup patch from http://drupal.org/node/1145702 prior to application of http://drupal.org/node/673988 - Could that be it? I will roll it back and re-apply in order and see what happens.

http://drupal.org/node/673988
http://drupal.org/node/897624

Did I miss something, or was automation not part of the functions?

I have included my patched modules to this post for evaluation.

Let me know what you think!

Thank you!

- Josh

jhrizz’s picture

I want to thank you for all of your help! Funny enough, combing through this code and logic, I had an epiphany, and solved it with rules, tokens content types. Because this is a combo solution that can't be expressed in a module, if anyone else is struggling with this and would like to know more, just ask. again, Thank you!

tinker’s picture

Hey sorry @jhrizz. I've been really busy lately and have not checked into drupal for ages.

Yes the solution outlined in post #1 does provide automated expiration of group access. When assigning the product feature you should see options to set a relative or fixed expiration date at the bottom. 'Relative' uses the purchase date and adds a configurable amount such as 1 year. 'Fixed' allows you to specify one date that the group access will end.

You must also patch og_expire for these settings to work:
- First apply patch from #1145702: Module does not follow Drupal code format standards
- Then the patch from #673988: API Function og_expire_set() shouldn't have access check.

Did you get any errors when applying patches? I don't think #673988 patch would work without first doing #1145702.