[ Similar question: How to add custom entities to group types? (Drupal Answers). But I ask specifically about ECK entities, not other simpler custom entities ]

I want to implement collections of certain custom (ECK) entities in a Drupal 8 project. I like the Group module and how it treats groups as entities, but custom entities are not directly available and a little module similar to gnode is needed, as explained in this answer (Drupal.org):

If you look at the group module, it also contains a gnode module that, when enabled, allows entities of type node to be added to groups. To be able to add entities of another type (like you make in ECK) you’ll need to make a gnode module equivalent.

More info in this piece of Group documentation.

I attempted something like that, from the code proposed in the above mentioned Drupal answer, just changing id, entity and module names, but it gets messy as it involves ECK bundles. Despite I am able to install the module and configure the corresponding available content:

  • If I "Add an existing entity", it saves and afterwards appears as an empty content. Clicking on Devel for more info crashes and tells me that "group" mandatory parameter is missing.
  • If I "Add a new entity", it crashes on the first step and tells about a missing bundle for this entity type.

Well, I understand that this is a more complex case and the module needs more functionality.

So... Before digging on what the module has to contain I wonder:

  1. Is this a good approach?
  2. Is there such a module already published (or at least any hint about it)?
  3. Should I take an easier road (with or without Group module)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.