Needs review
Project:
Subgroups for Organic groups
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
2 Jun 2011 at 04:19 UTC
Updated:
10 Nov 2011 at 01:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
bschilt commentedThis is not the intended behavior of subgroups at the moment. Propagation only happens when a user joins a group. Auto propagating when a new group is added to the tree is something that I would like to add at some point.
Comment #2
tbenice commentedOK. I'm happy to provide a patch.
How about simply adding this into og_subgroups_prop_nodeapi in the existing presave op?:
if (isset($node->og_parent)) {
global $user;
og_subgroups_prop_propagate_user('subscribe', $node->og_parent, $user->uid);
}
Or something like that.
This would allow subgroups_prop to decide whether propagation should affect the new subgroup no?
Comment #3
bschilt commentedI believe it would be a bit more involved than that. I think using the 'insert' op in the nodeapi function would be appropriate in this case.
Your patch would account for:
- all users in the parent group would need to be propagated to the new child group.
- account for both users and content.
- this should only happen for new groups only.
Comment #4
tbenice commentedYes, of course you're right, it'll be more involved and that was silly. I'll post a patch soon.
Comment #5
tbenice commentedHere's my first draft. I've been using it for a day or so and it seems to work fine.
It needs to support 'sibling' propagation and should allow admins to veto the behavior in the settings form. I believe that 'insert' fires only for new nodes correct?
Comment #6
tbenice commentedOK, here's a more mature effort. It allows admins to select whether to propagate to new subgroups. It also supports both 'children' and 'siblings' propagation for both members and content. Note, there are 2 patches in the file!
I've tested some, if someone would review I'd love to get this functionality into a release. Thanks!
Comment #7
mindaugasd commentedsubsribing
Comment #8
bschilt commentedI reviewed this a while back and for the most part it worked great but I did have some questions. I'll try to get back to this patch here soon.
Comment #9
at0g commented#6, This is good, thanks for the patch.
This should be included in og_subgroups