Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | rules_action.patch | 1.72 KB | Olarin |
rules_action.patch | 294 bytes | Olarin | |
Comments
Comment #1
Olarin CreditAttribution: Olarin commentedOops. It might help if the patch included the new file where all the useful code actually is.
Comment #2
daniorama CreditAttribution: daniorama commentedNice! 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!
Comment #3
Yuri CreditAttribution: Yuri commentedOMG I love us drupalists. Thank you so much Olarin.
Comment #4
niallmurphy-ie CreditAttribution: niallmurphy-ie commentedIs 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.
Comment #5
TR CreditAttribution: TR commented