Can you point us in the right direction? To add all existing nodes to a group, for example?

Comments

Lowell created an issue. See original summary.

maxilein’s picture

I'd be interested in that, too.
To me it is a critical question in order to find out how to migrate an existing site to the intriguing idea of the group module.

kristiaanvandeneynde’s picture

Well, you need a GroupContent entity for every Node belonging to a Group, so my advice would be to use the API that's available: GroupInterface::addContent()

The steps to take are roughly:

  1. Make sure you have a GroupType
  2. Make sure the GroupType has the right plugins enabled (GroupType::installContentPlugin(); read deprecation notice)
  3. Create a Group of said GroupType
  4. Start adding the nodes using $group->addContent($node, 'group_node:NODE_TYPE_HERE');
kristiaanvandeneynde’s picture

Status: Active » Fixed

Either that, or you set up your migration in three steps:

  1. Make sure a group exists (see above)
  2. Migrate nodes first
  3. Manually create GroupContent entities to avoid having to use the API

But that would require more thorough knowledge of the Group module's internals.

Anonymous’s picture

about #3 - if using $group->addContent($node, 'group_node:NODE_TYPE_HERE');
It works fine - thanks .

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

socialnicheguru’s picture

is there a relationship via dynamic entityrelationship or some other module that we can use?

weri’s picture

Component: Group Node (gnode) » Code