I assumed that cloning a field group from one display to another would assign the fields to the same groups they were assigned on the source display.
However, all that happens is that the groups get created -- none of the fields get assigned at all.

This makes the clone feature much less helpful than I had anticipated, as I still have to manually rearrange all the fields on the display settings.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stalski’s picture

Status: Active » Postponed (maintainer needs more info)

Are you cloning from the same content type (view mode to view mode) or from another content type with different fields?
It should be working if the same field_name's are found.

AaronBauman’s picture

yes, same node type. from Default to Colorbox modes, using the "Fieldgroups" vertical tab.
i didn't know there was a way to clone across different bundles or entities.

hexblot’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs review
FileSize
759 bytes

bumping the issue since it's still there - fields are not currently ( 7.x-1.4 ) being assigned to field groups after being cloned.

Thus, when cloning in the same content type (in my case, I pulled the field groups from the Form into the Display), the fieldsets are correctly cloned (type/metadata are all there), however there are NO fields in them, and the order is semi-random (I assume that if fields where nested, the order might be correct).

I've tried debugging a bit, and found that the actual place where the field children should be set is reset to array() - to me, that means there is not possibly way for this assignment to be working as it is.

In the attached patch, I've simply commented out that line, and it works just fine both for latest stable ( 7.x-1.4 ) and dev ( 7.x-1.x-dev ). Is this a proper way, or am I missing something that might create issues?

Status: Needs review » Needs work

The last submitted patch, 3: field_group_fix_clone.patch, failed testing.

hexblot’s picture

Status: Needs work » Needs review
FileSize
755 bytes

Rerolling the patch with git, hope this time it works

Status: Needs review » Needs work

The last submitted patch, 5: field_group-fix_cloning-1791744-3.patch, failed testing.

hexblot’s picture

Re-rolling patch

hexblot’s picture

Status: Needs work » Needs review
HunterElliott’s picture

Thank you for the patch! I just tried it with Entityform where I had to create different Displays to avoid a bug with file uploads throwing various errors. It worked great - I just created the new Display mode and then cloned the field groups from my Default display and it worked like a charm.

marleo’s picture

This works with 7.x-1.6 (applied manually.) Thank you!

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch in #7 to field_group.field_ui.inc does not apply to the latest field_group 7.x-1.x-dev and needs a reroll.

Checking patch field_group.field_ui.inc...
error: while searching for:
      $source_group->mode = $form_state['field_group_params']->mode;?
      $source_group->identifier = $source_group->group_name . '|' . $source_group->entity_type . '|' . $source_group->bundle . '|' . $form_state['field_group_params']->mode;?
      $source_group->disabled = FALSE;?
      $source_group->children = array();?
      unset($source_group->export_type, $source_group->type, $source_group->table);?
?
      // Save and enable it in ctools.?

error: patch failed: field_group.field_ui.inc:951
error: field_group.field_ui.inc: patch does not apply