Loading group_mapping_from_node.module +10 −1 Original line number Diff line number Diff line Loading @@ -125,12 +125,21 @@ function group_mapping_from_node_custom_submit(&$form, FormStateInterface $form_ if (!empty($group_ids)) { $plugin = 'group_node:' . $node->getType(); foreach ($group_ids as $group_id) { // During node creation $group_id is an array, we need to extract target_id key. if (isset($group_id['target_id'])) { $group_id = $group_id['target_id']; } // Load the Group to be added to the node. $group = Drupal::entityTypeManager()->getStorage('group')->load($group_id); // Map node with chosen group. if ($group) { $group->addContent($node, $plugin); } } } } Loading Loading
group_mapping_from_node.module +10 −1 Original line number Diff line number Diff line Loading @@ -125,12 +125,21 @@ function group_mapping_from_node_custom_submit(&$form, FormStateInterface $form_ if (!empty($group_ids)) { $plugin = 'group_node:' . $node->getType(); foreach ($group_ids as $group_id) { // During node creation $group_id is an array, we need to extract target_id key. if (isset($group_id['target_id'])) { $group_id = $group_id['target_id']; } // Load the Group to be added to the node. $group = Drupal::entityTypeManager()->getStorage('group')->load($group_id); // Map node with chosen group. if ($group) { $group->addContent($node, $plugin); } } } } Loading