When using Field Group Multipage with Profile2 Entities, there is an error as Field Group is checking in #groups but the groups are in #fieldgroups. This causes errors to display and the count of total pages to be 0.

I've tested all versions and the problem persists.

I know the fix needs to be universal but for now I just needed a patch to make this work. I also haven't done much testing, so there may be other problems with this. Attached so other people may use it in the meantime.

Patch against 1.3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

leex’s picture

Status: Needs work » Active
leex’s picture

crystaldawn’s picture

This exact same issue shows up when you have Profile2 displaying on the registration page. The issue there is that the multi-page form will not show AT ALL. This is because as the original poster here explains, profile2 uses fieldgroups rather than groups for an element. This was my quick hack to the field_group.module file right at the top of the field_group_fields_nest() function:

function field_group_fields_nest(&$element, &$vars = NULL) {

   //This is gives field_group.module compatibility with profile2 on the User Registration page -RyanC
   if (!empty($element['#fieldgroups']))
   {
      $element['#groups'] = $element['#fieldgroups'];
   }

  // Create all groups and keep a flat list of references to these groups.
  $group_references = array();
  foreach ($element['#groups'] as $group_name => $group) {
    $element[$group_name] = array();
    $group_references[$group_name] = &$element[$group_name];
  }

I use a custom module to monitor hacks like this, so hopefully the original poster's comments are taken seriously because it is definitely an issue. One could say that this is an issue with Profile2, but then Profile2 will just come back and say it's a field_groups issue, and then the vicious cycle never ends. I dont know who should take care of the issue, but it needs to be fixed by one of these modules.

jami3z’s picture

Here is a patch against the latest 1.4 release.

sime’s picture

Status: Active » Closed (works as designed)

I think this is works as designed - patch is sufficient for those who want to make profile2 work with field_group.