- Issue created by @phonkala
- 🇫🇮Finland phonkala
Hey there @LOBsTerr!
Have you had any time to check this out? I did a clean Drupal 10 install with just Group, this module (ggroup) and Views enabled and I'm experiencing same issue there, when creating subgroup the default membership just isn't created. I tested same with the Subgroup module (subgroup) too (the one I used earlier) and same issue there too, with clean install.
Could there be some limitation with the actual Group module that causes this? Just feels like something is missing, or maybe it's just me :) I tried enabling absolutely every permission in Parent and Child groups, and in admin > people > permissions, and still it's not creating the subgroup default membership. AND even enabled all the possible content plugins for both groups, but nothing changed.
- 🇧🇪Belgium lobsterr
Hi, I am sorry for the delay, I have completely forgotten to check it.
So, I have checked and it works as expected on my side.
I assume you didn't check the property "The group creator automatically becomes a member" for your subgroup type.Please check /admin/group/types/manage/[YOU_SUBGROUP_TYPE]
- 🇫🇮Finland phonkala
Hey!
No that's the first thing I checked. Actually I got all the checkboxes checked, when creating/managing a group type, for all of my group types.
Did you create the subgroup directly from the Group UI or as a subgroup of existing parent group via the group operations? If I create the subgroup just via the Group UI directly (then it has no parent group), the membership is created. But if I open a Parent group first and then create a Child group via group operations, the membership is never created. Just checked this with my original project and with the fresh Drupal 10 install, both act the same way.
- 🇧🇪Belgium lobsterr
This module doesn't not affect this functionality at all. It purely depends on this property "Group creator must complete their membership" of group module. Check Group entity postSave method.
It doesn't matter if you use different group types or the same. For a child group type this property must be checked.
I have checked again with different group types. It works as expected.I don't know why it doesn't work on your side. Please check your code for the hooks. I use in my case the clean instance of the Drupal.
- 🇫🇮Finland phonkala
It purely depends on this property "Group creator must complete their membership" of group module.
I guess you mean "The group creator automatically becomes a member"?
I made 20+ combinations of Parent and Child groups to test this with different settings, even added relationship fields for some combinations, and for me the Child group default membership is only created when:
1. The Child group type has the option "The group creator automatically becomes a member" checked.
2. AND the Child group type DOES NOT HAVE the option "Group creator must complete their membership" checked.I did a new, fresh Drupal 10 install just before testing this, but this is exactly how it behaves in my actual Drupal project too. There is no custom code related to this, and obviously not in the fresh Drupal install either. The "Group creator must complete their membership" option in the Parent (group) > Content > Subgroup (plugin) did not matter at all.
So for me the issue was having that "Group creator must complete their membership" checked for all my group types. I didn't need it at all, but had it checked just in case I sometime in the future decide to add fields to the relationships. So currently, I managed to get it working just by unchecking "Group creator must complete their membership", as I don't need it at all now. Obviously, for all my groups, I do have the option "The group creator automatically becomes a member" enabled (I think there might have been some confusion with those two options in last comments).
But ye, I got it working so no issue for me anymore. But if having the option "Group creator must complete their membership" checked should not interfere with creating the subgroup memberships, there might be something wrong. Though, I experienced this exact behaviour with Subgroup (subgroup) module too, tested that too yesterday and it behaves exactly same way than this module when it comes to auto-creating those subgroup memberships.
- Status changed to Closed: works as designed
7 months ago 11:34am 6 August 2024 - 🇧🇪Belgium lobsterr
Yes, I meant "The group creator automatically becomes a member" :(
I believe, it was a confusion, because you have several group types and probably you checked for the parent, but not for the child.
Anyway, let me know if you have any problems, we will try to find a solution!