A client requested this addition to regcode_og in order to streamline a workflow in their site, and it seemed generically useful enough to warrant contributing back to the module.

This simply adds an Action that can be used with Rules, which takes a regcode tag and an organic group, and creates a regcode_og rule to assign users with regcodes associated with that tag to that organic group. Basically, it's most likely useful if the Rule you're using it with already has Actions to create that particular tag and group, and saves you the step of manually making the association.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Olarin’s picture

Oops. It might help if the patch included the new file where all the useful code actually is.

daniorama’s picture

Nice! Would it be possible to add this to the code?

Also, do you have any ideas of how to also assign a role and/or a membership type?

Right now OG is changing a bit in membership types issues and I'm not sure how to handle them.

Thanks!

Yuri’s picture

OMG I love us drupalists. Thank you so much Olarin.

niallmurphy-ie’s picture

Issue summary: View changes

Is there anyone who could update this patch to work for 7.x-1.1?

I've tried editing the file myself but I'm hopeless..

I just added the code to the end of the regcode.rules.inc file but when I try to run the action, I can't select the "group" I created earlier in the rule. There's no gid anywhere to choose from.?
I then changed the type to Node instead of Group and it gives errors.

I think this patch would complete the functionality of creating a group + reg code automatically from an entityform rule.

Thanks if anyone can help out.

TR’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Code » Rules integration