So, kristiaanvandeneynde, if I understand aright, Groups is basically a complete revamp of the older Organic Groups concept done up as proper Entities to make it potentially much more flexible in D7 and compatible moving forward with D8 and up. Am I right on this?

Have you looked at the powerful yet lightweight Relation module? It's basically an API and Views Integration module with little in the way of user interface (even at admin). It’s fully Entities-based — unlike Entity Relationships and the like, Relations themselves are Entities and can themselves have fields in addition to those on the endpoint Entities. The Relation module and its API go way beyond one-to-one, one-to-many, or even many-to-many relations. It allows relations to be directional or symmetrical, transitive (not actually implemented yet, but the API structure is there), any cardinality (there can be any number of endpoints in a given relationship, not just two), and so on.

Best part: creating a relationship via Relation automatically creates the reverse relationship, so making a Group a Parent of a Node automatically makes the Node a Child of the Group. This doesn’t happen with the likes of Entity Relationship. (Actually, Entity Relationship does currently provide back-reference relationships, at least via Views integration which provides relationships not only for “Children referencing Parent” but also “Parent referenced by Children” ― be careful which relationship wording you pick!)

In looking over many of the Feature Requests in this queue, it seems to me that if Groups were to be redone as being based on not just Entities but Relations as well, that many of them would be much easier to accomplish, and the whole system would become much more powerful.

Example: #2317195: Allow more than one parent by node / subgroup. That one has, as of the time I write this, 62 (now 76) Replies, many of them from you. The issue is almost 2½ years old as of this writing. Therein you say that it would be a very powerful feature but that you designed the system to have only one parent per node to get a release version out more quickly. Multiple patches were supplied to kludge it in, and apparently there is one that does a decent job. But if Groups were Relations-based, this would’ve been so much easier to implement right from the beginning.

Here’s the sort of thing that could be done with a Relation-based Group module system: Imagine a nationwide or international association of, say, vocal groups, ranging from choirs to small ensembles and quartets and trios and the like. The main organization is divided into regions or districts or whatever, and under those are chapters or churches or whatever, each of which can have one or more choruses or choirs or chorales or whatever. A chapter can also have trios or quartets that contain singers which may or may not also be members of the choir (on an individual basis). A person could be a member of a quartet and a chapter, and a given quartet could also be independent of any chapters but still under a region, or could even have members that are in multiple regions that get together for tours and contests.

Because Relations themselves are Entities and thus fieldable, the Relation of a Singer to a Quartet or Chorus Group Entity can have a Field for, say, Voice Part (in this case a Term Reference to a Taxonomy vocabulary). This way, the same Singer who sings Baritone in Choir A could also sing Bass in Quartet B. This is not the sort of thing that could easily be stored in the user’s Profile, since it could differ based on which groups s/he’s a member of.

I’m not sure if I’m using the Issue Queue the right way for something like this. Is “Plan” the correct category, or “Task”? It’s a bit more than a mere “Feature Request,” I’d think. If I did this wrong, I apologize.

(Edited to increment the version number, since it’s apparent to me that the #2317195-70: Allow more than one parent by node / subgroup in and of itself justifies a 7.x-2.x release because it introduces significant backwards incompatibilities.)

(Edited again to restore the original proposed 2.x version number since kristiaanvandeneynde has stated in #2317195-71: Allow more than one parent by node / subgroup that the plan now is to incorporate the Multiple Parent Group functionality into the release version of 7.x-1.x now that the D8 version of the node access code has been backported.)

Comments

Joel MMCC created an issue. See original summary.

Joel MMCC’s picture

Issue summary: View changes
kristiaanvandeneynde’s picture

Hi Joel and thanks for the really thorough explanation. In Group 8, all of the relations are now single-multiple, multiple-multiple or single-single because there is now one system to relate any content to a group that can handle all scenarios.

I'd be very willing to look into the Relation module for an 8.x-.2.x branch on the condition that it would not make the UX or performance (much) worse. To give you an idea of the D8 implementation:

  • Every entity is tied to a group using a GroupContent entity; this represents the relationship.
  • The entity is fieldable, but can be excluded from the workflow when not fielded. This means you either have a single form to add something to a group or a 2-step wizard.
  • You can manually set certain limits: How many times a single entity can be added to the same group and/or how many groups it can be added to.

If you have any further questions, don't hesitate to ask. When I open the 2.x branch, I'll make sure to have a look at the Relation module.

Joel MMCC’s picture

The way I see it, using Relation would save you a lot of work in a 2.x rewrite, as it would provide the storage and API and Views / Rules integration and such for you to do pretty much anything you could imagine with Groups. Group 2.x would basically be a UI and preset Relations-type wrapper for Relations.

Sounds like the existing Group 8,x-1.x version is pretty much a specialized mini-version of a Relation-like module as it is, especially since GroupContent is itself a fieldable entity.

Unfortunately, the project I’m developing has to be done in D7 at present since other key modules and functionality thereof that the project absolutely depends on haven’t been ported to D8 yet (and some may never be). I’m running into serious headaches with Group 7.x-1.x, some of which I’ve posted Issues about here.

Joel MMCC’s picture

Title: Proposal: New 2.x branch rewrite based on Relation module » Proposal: New 3.x branch rewrite based on Relation module
Issue summary: View changes
Joel MMCC’s picture

Issue summary: View changes
Joel MMCC’s picture

Title: Proposal: New 3.x branch rewrite based on Relation module » Proposal: New 2.x branch rewrite based on Relation module
Issue summary: View changes
Joel MMCC’s picture

It seems to me that the main things that Group does that Relation does not is that it has a decent user interface (the one for Relation sucks, but then again, it’s meant to be an API module, inviting other modules that wish to use it as their underlying relationships engine to provide their own UIs customized for the particular functionality they wish to provide, such as groups in this case), and also that yours provides powerful node access functionality, enabling Group Roles and controlling access based on those. Relation in and of itself provides no node or other content / entity access functionality.

Well, turns out that there’s a Node Access Relation module! You could maybe use its code to see how to go about implementing the node / content entity access functionality into a Relation-based Group module.

soul88’s picture

Status: Active » Closed (outdated)

We thank everyone for their collaboration on this issue, but as the D7 version is no longer supported, we will now close all D7 issues to keep the issue queue a bit tidier. This information won't go anywhere, it just won't show up on the list of open issues anymore.

Please see: https://www.drupal.org/project/group/issues/3163655 and https://www.drupal.org/project/group/issues/3203863#comment-14100281 for more details.