Problem/Motivation

Entity repeat group module does not work with newer version of group.

Error: Call to undefined method Drupal\group\Entity\Group::addContent() in _entity_repeat_group_submit() (line 107

addContent and other group functions has been replaced by "addRelationship()"

Steps to reproduce

Install this module with the latest versions of group in D9.4

Proposed resolution

Code needs update

See https://www.drupal.org/docs/contributed-modules/group/updating-your-modu...
for information on the relationship handlers needed

Comments

webberly created an issue. See original summary.

  • kyoder committed e923c397 on 1.0.x
    Issue #3343586 by kyoder: Update entity_repeat_group submodule to...
kyoder’s picture

Support for Group 3 added in latest stable release 1.0.9

kyoder’s picture

Status: Active » Fixed
kyoder’s picture

Status: Fixed » Closed (fixed)
webberly’s picture

Thank you for your work.
It looks like $group_content_enabler in "$group->addRelationship($replicate, $group_content_enabler);" is NULL so its not creating the relationship and throws and error "Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID '' was not found. in Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (line 79 of /var/www/clients/client1/web19/web/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php)."

In the batch processing it only creates the first entity with the relationship, the others are created without the group relationship.

When I manually replace "$group->addRelationship($replicate, $group_content_enabler);"
with
$group->addRelationship($replicate, "name_of_plugin:bundle_name");
it works
So it might be able to get the plugin and bundle from $form_state->getformObject()->getEntity();

kyoder’s picture

Thank you for the bug report webberly and your patience, I've made a new release 1.1.0 that should resolve all the issues with Group 3.