Index: content_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content_admin.inc,v
retrieving revision 1.12.2.33
diff -u -r1.12.2.33 content_admin.inc
--- content_admin.inc	4 Feb 2007 02:21:24 -0000	1.12.2.33
+++ content_admin.inc	7 Feb 2007 15:44:55 -0000
@@ -185,6 +185,17 @@
       // and move existing fields to separate shared table, if not already shared
       _content_admin_field_add_existing_submit('_content_admin_field_add_existing', $field_values);
     }
+    if (module_exist('fieldgroup')) {
+      foreach (fieldgroup_groups($form_values['original_type_name']) as $group_name => $group) {
+        db_query("INSERT INTO {node_group} (type_name, group_name, label, settings, description, weight)
+                  VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $form_values['type_name'], $group_name, $group['label'], serialize($group['settings']), $group['description'], $group['weight']);
+        foreach ($group['fields'] as $field_name => $field) {
+          db_query("INSERT INTO {node_group_fields} (type_name, group_name, field_name) VALUES ('%s', '%s', '%s')",
+                $form_values['type_name'], $group_name, $field_name);
+        }
+      }
+      cache_clear_all('fieldgroup_data');
+    }
   }
 
   drupal_set_message(t('Saved content type %type.', array('%type' => theme('placeholder', $form_values['label']))));
