When i have configured field groups on a node_registration content type. The field groups are not copied when setting up private fields for a registration node.

This will provide this functionality.


  // Copy field groups.
  if (module_exists('field_group')) {
    $modes = field_group_info_groups('node_registration', 'workshop');
    foreach ($modes as $key => $groups) {
      foreach($groups as $group) {
        $new_group = clone $group;
        $new_group->bundle = $bundle;
        $new_group->identifier = $new_group->group_name . '|' . $new_group->entity_type . '|' . $new_group->bundle . '|' . $new_group->mode;
        unset($new_group->id);
        unset($new_group->export_type);
        field_group_group_save($new_group);
      }
    }
  }

Comments

Tom Robert created an issue. See original summary.

tom robert’s picture

StatusFileSize
new1.05 KB
rudiedirkx’s picture

Status: Active » Needs review

Oh, "private fields" was such a bad idea. Shame on me. What I use these days is Webform Fields, which allows you per-node registration fields, but with the same NR bundle. Display and Views works differently though...

I'll review and test later.

colinstables’s picture

Can you provide a link to Webform Fields as i can not find it for node registration module?

rudiedirkx’s picture

I did provide a link =)

colinstables’s picture

Well its not working i even searched the whole data base for Webform Fields to no avail can you please attach link here to module sorry :)

Your link leads to a SandBox?

rudiedirkx’s picture

#3 has a link to Webform Fields...

Yes, it's a sandbox.