Needs review
Project:
Organic Groups
Version:
7.x-2.x-dev
Component:
OG actions
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2012 at 18:37 UTC
Updated:
7 Feb 2018 at 15:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
john.p.baldwin.jr commentedI've decided I believe this feature isn't working properly yet (hence the category change). I installed the 7.1 branch and the behavior is similar to what's available in Drupal 6, where assigning a user to a group can be done with a select menu.
I am willing to work on patches to improve rules integration if it won't conflict with anybody else's work.
Comment #2
svnindia commentedhi,
//where assigning a user to a group can be done with a select menu.//
could you tell me how to assign a private group to a user
Comment #3
john.p.baldwin.jr commentedI've attached a preliminary patch to see if this direction is desirable.
I was able to create a rule to assign a user to a group when an account is created.
Event: After saving a new user account
Condition: None
Action: Assign user to group (User set to "account", Group chosen from the drop-down menu).
After doing this, the newly created user was indeed assigned to the group selected.
John
Comment #4
altbzh commentedHi,
With what version does your patch work, please ?
Thank you
Comment #5
john.p.baldwin.jr commentedI applied this patch against the latest version under git.
If you go to this url:
http://drupal.org/project/og/git-instructions
And select the 7.x-2.x version, the patch should work.
Comment #6
altbzh commentedok thank you, I will try.
Comment #7
JohnnyX commentedI'll try to build a widget to add/ remove users (for example at profile) to own groups. I'll give it a try with your patch as starting point...
Comment #8
JohnnyX commentedAny idea how the group which the user should un-/subscribe could be selected instead to define it inside the rule?
So user should select the group(s) the user (which profile is viewed) added to/ removed from...
Comment #9
amitaibuYou should load the entity that is a group, one action before, so it can be provided in the data selector.
(btw, The patch in #3 isn't scalable -- image 100K groups...)
Comment #10
marqpdx commentedI applied the patch from #3 above and it appears to work.
I had to make sure to be in direct Input mode in the rule setting (Action step) for the group dropdown to show up.
Also, i had it setup to run after saving a new user, but the didn't work, b/c (when i checked the db) there was a 0 for the entity ID in the group membership.
So i changed our workflow. I require people to change their password to activate their account, and i changed the rule to automatically add them to the group when they update their user account. It added them successfully to the group.
Thanks,
m
Comment #11
Marfio commentedFirst of all, thank you for the patch.
I used it to subscribe an user role into a group. It works fine.
The only thing you have to be careful is to don't have the "Organic groups context" module active. I couldn't run the patch with that module active.
If anyone needs the rule, Insert an specific role to a group
Event
After update user count
Conditions:
User have roles
User:Account
Rols: YOUR ROLE
Acitions
Subscribe user to group
User:Account
Group:Choose from the list
Comment #12
jcarrothers commentedDid this patch ever make it into a release?
I attempted to use this functionality on my own site with 7.x-2.4 and I discovered, upon checking the module source code, that this patch doesn't seem to have been applied to the current release.
Comment #13
farshid commentedAdding my 2 cents:
In my case I wanted to subscribe a user to a group, and I was getting an error in dblog, something about anonymous user... and that the subscription can't be done, don't recall the exact error, I added a save entity action on newly created user before og subscribe to group action and it was done.
Comment #14
jeroenmarinusI can confirm this patch works, but has not made it into a release.
Therefore, reopening the issue to be tested a bit more and then hopefully get committed.
Comment #15
ybabel commented"Fetch entity by ID" can do the job. No really need for this patch.
Comment #16
docans commentedHi
I am using drupal commons for my site and i need to automatically assign my user to a particular group base on the taxonomy terms they select
I have a taxonomy term of "states" which shows up on both the user registration form and is also associated to each group
So during a new user registration, when the user select the state of "new york" which has term ID of 15 ,He is automatically assigned to the "new york community" group because the "new york community" group also has been tagged to the "new york" tag.
Any Ideas on how to do this.
Thanks
Comment #17
cassio commentedDigging around in other threads, it seems like the user does not have the right role initially to be added to the group. (starts out as anonymous)
Comment #18
rsbecker commentedThis patch works well for its intended purpose. But there is still a problem.
I have a rule that fires when a person is added to a group. That rule flags the user to receive email notifications about new group content.
If I manually add a user to a group, the flags are set and the email subscription shows up in the user profile. But if I use the rule to add a new user to a group, the "User has become a group member" event appears not to occur. So the user is added to the group but the email subscription isn't created.
Comment #19
edunick commentedThis patch works only one group. For multiple group, I modify the next code: