To accelerate the process of subgroup module acceptance. It was decided to split the subgroup core functionality and role inheritance.
This issue will keep only information of core functionality.
Current module we will provide the next functionality:
1) Plugin GroupContentEnabler
2) Graph functionality to provide relationship between groups
3) GroupHierarchyManager, which will handle most operation related relations between groups
4) Views to display subgroups of the current group
5) Functionality to add subgroups
We will keep the graph functionality of subgroup here, for the next reasons:
1) The existing sites can be on the safe side, because the graph already contains the data for the current group.
2) We will not have any conflicts with existing table
3) In the future other modules can provide additional functionality based on the graph
Comment | File | Size | Author |
---|---|---|---|
#25 | 3084140-25.patch | 102.25 KB | LOBsTerr |
#22 | 3084140-22.patch | 102.56 KB | ridhimaabrol24 |
#21 | subgroup_core-3084140-21.patch | 102.63 KB | kolesnikoff |
#18 | subgroup_core-3084140-18.patch | 102.54 KB | LOBsTerr |
#18 | interdiff-17-18.txt | 3.47 KB | LOBsTerr |
Issue fork group-3084140
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
catchThe patch is missing here.
While testing this, I noticed that the subgroups view is using the wrong relationship - this means it lists all groups content, rather than subgroups.
Since there's no patch to update yet, uploading the exported YAML for reference.
Comment #3
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedOps. I didn't add the patch
Comment #4
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commented@catch I have updated the view. Once #2873212: Add a status to the group (Publish/Unpublish) is merged, we need to add published filter to the view
Comment #5
floydm CreditAttribution: floydm at Affinity Bridge commentedIn the last patch the view display name changed from page to page_1, which makes the 'Relate subgroup' and 'Create subgroup' links disappear.
This patch updates the ggroup.links.action.yml file to point to the updated display name.
Comment #6
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedReplace the translation string to correct one. More info here [%3074015]
Comment #7
zcht CreditAttribution: zcht commentedI found a bug where I can't create subgroups. Despite the authorization, the user cannot create subgroups. I can only link existing subgroups using the entity. Also Access subgroup overview cannot be accessed.
to readjust:
* create a group
* create a subgroup (without further node-types, only the subgroup)
* set permission to: access subgroup overview and subgroup type Create new subgroups
* log in with the user who has the authorization
go to the subgroup overview page - there is no menu displayed and no button to insert. only when add subgroup relation is selected in the permissions, it is possible to insert new subgroup. however, i need new subgroups, no entity link.
this bug does not appear, if a node-type is installed for the group. then it works without problems, but i do not need a node-type for the first group.
for my main group i only have the following in use: subgroup, group membership and group membership request
my structure looks like this:
* main group with many users
* users can create new subgroups in the main group
* node-types can be inserted in the subgroups
unfortunately my structure doesn't work like this at the moment. i'm not a drupal developer and can't fix the problem, but i hope that someone can fix this bug. thanks a lot in advance.
---
and one more thing: if a user has a role that only has view subgroups, this user can still edit the subgroups. so in the admin overview all groups are shown, with a dropdown in the button the group information can be edited or even the whole subgroup can be deleted. but the user is not allowed to create a new subgroup, nor edit or delete the subgroups.
Comment #8
TechnoTim2010 CreditAttribution: TechnoTim2010 commentedI tried this code patch, while you can add existing groups as subgroups via adding content, the realities of using this were less than perfect.
On the face of it subgroups was ideal for the content and user architecture I have. But I needed to create views to drill down from a group into the subgroup and get the subgroups content. Views did not allow this though. I ended up having relationships that were more confusing than illuminating and the returned subgroup content ID (e.g. Node ID) was impossible to get. Instead I got the subgroup ID not the subgroups group ID (from where I could get the related content).
Comment #9
kristiaanvandeneyndeWe are currently in the process of developing a fully supported Subgroup module for a client. The architectural decisions here do not fully match what I had in mind, but we will use this thread's patch, discussion and related issues to see which issues people ran into and how they resolved them.
I'm hoping the end results will please everyone. Do keep in mind that the architecture I currently have in mind also focuses on ease of configuration and performance. It will support role inheritance both up and down an ancestry tree and will even allow for circular inheritance so you can achieve scenarios such as "member of child inherits member permissions in parent, but also vice versa".
That's about all I can say now, but I wanted to keep you all informed that this is now in the works.
Comment #10
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedReroll
Comment #12
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedWe need to follow the latest changes related to Drupal 9 (#3088226: Remove deprecations, compatibility with Drupal 9). Replaced Drupal\user\PrivateTempStoreFactory with Drupal\Core\TempStore\PrivateTempStoreFactory.
Comment #13
dbielke1986 CreditAttribution: dbielke1986 commentedHello community,
I have a question of understanding in the area of node access and subgroups. In order not to mix up the topics, I have posted a separate issue. Could someone help me with this or could someone take a look at it.
Understanding Node Access with SubGroups
BR,
Daniel
Comment #14
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedthe patch in #12 does not apply to dev version.
everything else passes except for the changes to the .composer file
patching file composer.json
Hunk #1 FAILED at 23.
1 out of 1 hunk FAILED -- saving rejects to file composer.json.rej
patching file modules/ggroup/config/optional/views.view.subgroups.yml
patching file modules/ggroup/ggroup.group.permissions.yml
patching file modules/ggroup/ggroup.info.yml
patching file modules/ggroup/ggroup.install
patching file modules/ggroup/ggroup.links.action.yml
patching file modules/ggroup/ggroup.module
patching file modules/ggroup/ggroup.routing.yml
patching file modules/ggroup/ggroup.services.yml
patching file modules/ggroup/ggroup.tokens.inc
patching file modules/ggroup/ggroup.views.inc
patching file modules/ggroup/src/Access/SubgroupAddAccessCheck.php
patching file modules/ggroup/src/Controller/SubgroupController.php
patching file modules/ggroup/src/Controller/SubgroupWizardController.php
patching file modules/ggroup/src/Form/SubgroupFormStep1.php
patching file modules/ggroup/src/Form/SubgroupFormStep2.php
patching file modules/ggroup/src/Graph/CyclicGraphException.php
patching file modules/ggroup/src/Graph/GroupGraphStorageInterface.php
patching file modules/ggroup/src/Graph/SqlGroupGraphStorage.php
patching file modules/ggroup/src/GroupHierarchyManager.php
patching file modules/ggroup/src/GroupHierarchyManagerInterface.php
patching file modules/ggroup/src/Plugin/GroupContentEnabler/Subgroup.php
patching file modules/ggroup/src/Plugin/GroupContentEnabler/SubgroupDeriver.php
patching file modules/ggroup/src/Plugin/Validation/Constraint/GroupSubgroupConstraint.php
patching file modules/ggroup/src/Plugin/Validation/Constraint/GroupSubgroupConstraintValidator.php
patching file modules/ggroup/src/Plugin/views/argument/GroupIdDepth.php
patching file modules/ggroup/src/Routing/SubgroupRouteProvider.php
patching file modules/ggroup/tests/modules/ggroup_test_config/config/install/group.content_type.default-subgroup-subgroup.yml
patching file modules/ggroup/tests/modules/ggroup_test_config/config/install/group.type.subgroup.yml
patching file modules/ggroup/tests/modules/ggroup_test_config/ggroup_test_config.info.yml
patching file modules/ggroup/tests/src/Kernel/SubgroupTest.php
patching file src/Access/GroupPermissionChecker.php
Comment #15
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedI know, what is the reason. I will do the reroll
Comment #16
dwkitchen CreditAttribution: dwkitchen commentedRe-rolled the patch fixing the issue in composer.json
Comment #17
dwkitchen CreditAttribution: dwkitchen commentedRe-rolling again - applying patches in PhpStorm allows fixing issues, but it lost the directory depth...
Comment #18
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedI have added permission_provider for SubGroupEnabler, which has been recently presented.
Comment #20
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedit still applies... just a composer glitch
(DELETE)
reroll needed for new dev version of groupComment #21
kolesnikoff CreditAttribution: kolesnikoff commentedExactly the same patch as in #18, just added
core_version_requirement: ^8 || ^9
because the code is compatible with Drupal 9.Comment #22
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedThe above patch failed to apply. Uploading the correct one
Comment #24
ggj CreditAttribution: ggj commentedIn the above patches,
shouldn't it be "create subgroup:{$group_type->id()} entity" instead?
Wondering what the expected behavior is because I receive access denied unless I have "administer group" permissions. This change fixes it.
Comment #25
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedThe patch still fails, with the latest updates, because of composer.json
I have dropped.
Anyway drupal 8 requires php 7. Now after rerrol it will be applied correctly
Comment #26
dbielke1986 CreditAttribution: dbielke1986 commentedDo we need to update this module because of the changes which were made to the groupe 1.0/1.1 release?
I mean the following:
and
Comment #27
dbielke1986 CreditAttribution: dbielke1986 commentedAnother question:
Shouldn´t we use the official contrib modul instead of using this group modul modification?
https://www.drupal.org/project/subgroup
Comment #28
catchLet's mark this postponed on https://www.drupal.org/project/subgroup - then the project maintainer can mark duplicate if they want to.
Comment #29
dbielke1986 CreditAttribution: dbielke1986 commentedOk, as we found out in the discussion with the maintainer of the subgroup module, it is not a duplicate, but takes a different approach.
The difference, for me, is that the subgroup module only allows one "one child group can only belong to one parent group".
This implementation here allows a "one child group can belong to several parent groups".
Maybe this variant, though not in the core of the group module, will make it into a separate Contrib module. I would be very pleased!
Comment #30
dwkitchen CreditAttribution: dwkitchen at CommitteeHQ commentedYes,
subgroup
takes a very different approach.@JD_1 mentions the "one child group can only belong to one parent group" limitation; in addition for me the "one group type can only be in one group hierarchy once" blocks use of
subgroup
.The state of my project means continuing with
ggroup
, given the creation ofsubgroup
as a stand alone module we should also consider that this module will not become part of thegroup
project. So I have set upggroup
as its own project and I have added @LOBsTerr as maintainer.These two options for building sub-group hierarchy will have to co-exist and not be compatible with each other.
This will also bring #3084153: Subgroup role mapper into the new ggroup module.
Comment #31
zcht CreditAttribution: zcht commenteddoesn't it make more sense to continue working on the subgroup module? maybe find a solution for the problem with a subgroup? for my project i would also need several child groups in one parent group, but i would prefer to use the subgroup module. it is most likely to be maintained, is 100% compatible with the group module.
i see problems and incopatibilities coming up if two identical projects differ only slightly in detail. this would only unsettle future users and if the "wrong" module is selected, the user has no possibility to switch, even a migration i don't see here.
Comment #32
dwkitchen CreditAttribution: dwkitchen at CommitteeHQ commentedHi @zcht, you can if you have two different group types, use
subgroup
to build what you described.As @kristiaanvandeneynde said in #3084140-9: Subgroups core module
Specifically in
subgroup
the tree structure is managed usingthird_party_settings
on thegroup_type
. This means that Group Type A cannot have children that are also of Group Type A. Further a Group of Type D cannot be a child of a Group of Type A, B or C.Interestingly this is the opposite reason for why I created Entity Reference (with) Hierarchy compared to Entity Reference Hierarchy, the latter builds a hierarchy chain through config fields as this
ggroup
does.Comment #33
kristiaanvandeneyndeIf you want I could explain the reasoning behind Subgroup's architecture further and why I chose that one over ggroup's approach. But right now I have other fish to fry before I go on vacation so it will have to wait until roughly end of August :)
Comment #34
zcht CreditAttribution: zcht commentedHi @dwkitchen,
yeah, you got that right. Not out-of-the-box, though, as only one child of a type is allowed here. But this can surely be solved easily.
I wanted to get back to the general topic in a more regular way. I don't think it's beneficial to create two modules that are designed for the same purpose and differ only slightly in detail. Personally, I also think it's a pity that all the work for the patches was not considered and a different construct was implemented. But I think that we definitely need to join forces for the subgroup module. There are many reasons for this: compatibility, RC version - soon to be stable and therefore considered by the security team, membership/role workflows will be much easier, certainly also the performance (here we always had a problem with subgroup as patch), many patches for patches for patches will be omitted... we had some of them for the RC5, which had to be adapted again and again.
If the community applies the work to a module, many will benefit. But if we develop two modules, the valuable work resource is lost. I think we can definitely find workarounds for the new subgroup module. I would even have gone one step further and implemented the module in the group core, the group module is used for a reason, the subgroups are almost mandatory for many use cases.
The discussion just reminds me of Drupal vs. Backdrop CMS, I think we should avoid that and find a holistic solution. :)
Comment #35
kristiaanvandeneyndeIt was considered, but the graph approach in this patch has significant downsides compared to the nested set model when it comes to reading the data. As the majority of operations are reads, I chose the system that guarantees optimal performance during read operations as that's what powers the calculation of your permissions.
Upon further review, I noticed this module closely follows what's already there (gnode, group content wizards), but I'm trying to go for a more generic approach nowadays. You'll notice that the gnode module is rather empty these days and that's because group core will soon be able to support most simple entity types without having to write a submodule for it.
So I too regret I couldn't build upon this patch, especially given the excellent work @LOBsTerr has been doing for Group. It's just that, in this matter, we had someone paying for the delivery of Subgroup and it didn't make sense to continue working on an existing module if that module's foundation doesn't match what you think is best for performance and stability (nested set model). It's hard to accept payment while promising good performance and then work with code that you know might form a bottleneck.
The limitations currently found in Subgroup aren't all permanent either. While it's definitely not the goal to allow multiple parents (due to stability/performance reasons), it could become possible to add existing groups to a tree later on. It's just that this raises so many questions and security risks that we chose not to target it for a first release. Especially given how our client was building a site from scratch and had no need for it.
Comment #36
kristiaanvandeneyndeFor what it's worth, @LOBsTerr seems to have done a great job translating what I believe to be this graph algorithm into Drupal. https://www.comp.nus.edu.sg/~ooiwt/slides/2007-ioi-training-graph.pdf
It's just that most use cases need a hierarchy tree rather than a "net" and for that particular use case, nested set is both simpler and more performant.
Comment #37
dwkitchen CreditAttribution: dwkitchen at CommitteeHQ commentedHi @zcht,
I would say think of this more as the difference between Display Suite and Fences.
Here is how I have explained the difference on the project page:
ggroup
Has more flexibility in including poly-trees, however graph enumeration requires more processing.
subgroup
Configuration limits that a Group Type has a fixed position in tree.
Rooted tree enumeration is simpler than graph enumeration (quicker/less processing)
One of the issues with all the patches, is we can see that Group module is reporting over 9k sites - but we don't know how many are using the Subgroup patch.
Comment #38
jedgar1mx CreditAttribution: jedgar1mx commentedI would say a big issue is the comparability of the patch with the latest version of `group`
Comment #39
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedI close this ticket, because as it was mentioned now it is a contributed module. Please post any issues there. Thanks
https://www.drupal.org/project/ggroup
Comment #40
jedgar1mx CreditAttribution: jedgar1mx commentedI was able to upgrade switch to
ggroup
module without problems and upgradedgroups
to the latest version. 👍