I'm using Group module.

When we create a group content, there is a need of creating a group node and we can noticed that the submit message is this: Continue to final step. Then when we tick the button, we are directed to final confirmation to create the group node so that group content will be successfully created.

I am aware of the set up but what I want is that when I create a group content, group node will also be created without the second confirmation button.

Is this possible? Or can this be achieve in templating, if so, how?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnreytanquinco created an issue. See original summary.

alan.upstone’s picture

Hello John Rey

If I have understood you correctly, you want to create content in a group without having to use a two-step form. The extra step is in case you want to store some data on the group content entity, which records the relationship between the group and the content (the node).

If you don't want that extra step, you can untick the box described in comments 27 and 28 of this fix provide a generic and extensible UI for adding new content into a Group.

Cheers
Alan

kristiaanvandeneynde’s picture

Status: Active » Closed (works as designed)

Excellent explanation by Alan, thanks for that!

johnreytanquinco’s picture

Perfect! That is the solution I needed. But when I tried to apply the patch, I encountered this error running drush cr,
PHP Fatal error: Cannot redeclare Drupal\group\Entity\Routing\GroupContentRouteProvider::getRoutes() in /Applications/MAMP/htdocs/drupal-8.2.3/modules/group/src/Entity/Routing/GroupContentRouteProvider.php on line 69

Also, when I test creating another group, I wasn't able to gain access on the group. So, I check the group permission and got another error of this:
PHP Fatal error: Call to undefined method Drupal\gnode\Plugin\GroupContentEnabler\GroupNode::getEntityType() in /Applications/MAMP/htdocs/drupal-8.2.3/modules/group/src/Plugin/GroupContentEnablerBase.php on line 192

Thanks again.

johnreytanquinco’s picture

Status: Closed (works as designed) » Needs review
johnreytanquinco’s picture

Status: Needs review » Closed (works as designed)

Alright, I reverse the patch and just did an update to the module. It works smoothly. Errors are gone. Thanks Alan for the answer and Kristiaan for your great module! Cheers!