Is the intended behavior for "membership propagation to children" to automatically join parent group members to new subgroups? It doesn't seem to happen in my application...

Comments

bschilt’s picture

Status: Active » Closed (works as designed)

This 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.

tbenice’s picture

OK. 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?

bschilt’s picture

Status: Closed (works as designed) » Active

I 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.

tbenice’s picture

Yes, of course you're right, it'll be more involved and that was silly. I'll post a patch soon.

tbenice’s picture

Title: membership propagation down to new subgroups » member and content propagation down to new subgroups
Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Assigned: Unassigned » tbenice
Category: support » feature
Status: Active » Needs review
StatusFileSize
new1.66 KB

Here'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?

tbenice’s picture

OK, 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!

mindaugasd’s picture

subsribing

bschilt’s picture

I 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.

at0g’s picture

#6, This is good, thanks for the patch.
This should be included in og_subgroups