I've put in a new hook here so that the $group_options that are added to the ucreate_user_form can be adjusted by other modules.
diff --git a/html/sites/all/modules/ucreate/ucreate_og.module b/html/sites/all/modules/ucreate/ucreate_og.module
index 0677458..a613635 100644
--- a/html/sites/all/modules/ucreate/ucreate_og.module
+++ b/html/sites/all/modules/ucreate/ucreate_og.module
@@ -118,6 +118,12 @@ function _ucreate_og_form(&$form) {
else if ($og) {
$group_options = array($og);
}
+
+ // allow other modules to alter the group options
+ foreach(module_implements('ucreate_og_form_alter') as $module) {
+ $function = $module .'_ucreate_og_form_alter';
+ call_user_func_array($function, $group_options);
+ }
$options = array();
foreach ($group_options as $group) {
This allows me to check a certain user role that can add a user to any group, not just the ones they are joined into.
Comments
Comment #1
sirkitree commentedI'll add that ideally, there should be a permission that would just allow a role to do this, but this serves my purposes for now. Happy to write it up the other way if you prefer.
Comment #2
sirkitree commentedMarking as needs review.
Comment #3
sirkitree commentedOops, small bug: changed call_user_func_array to call_user_func
Comment #4
sirkitree commentedOk, for real this time ;)
Comment #5
alex_b commentedWhy don't you use just form_alter() for this?
Comment #6
sirkitree commentedthe ucreate stuff is already form altered in, and when i tried to do so in my own module, the og info was not available.
Comment #7
jmiccolis commented@sirkitree is that just due to a module weight issue? If you set you modules weight to higher than ucreate it should just work right?
Comment #8
sirkitree commentedHrm, I don't know. I think I remember that I tried that and it did not work. It's been long enough that I'm not working on the project I was when I had this issue, but it's coming up for Phase 2 soon. davexoxide is on that part though so I'll let him know about this ticket and maybe he will follow up.