Index: content_copy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/modules/content_copy/content_copy.module,v
retrieving revision 1.27.2.16
diff -u -r1.27.2.16 content_copy.module
--- content_copy.module	28 Oct 2008 02:29:21 -0000	1.27.2.16
+++ content_copy.module	31 Oct 2008 20:19:00 -0000
@@ -379,16 +379,38 @@
   }
 
   // Make sure that all the field and widget modules in the import are enabled in this database.
-  foreach ($imported_fields as $import) {
+  foreach ($imported_fields as $key => $import) {
     $field = content_field_instance_collapse($import);
     if (empty($field['module']) || empty($field['widget_module'])) {
-      $not_enabled[] = $field['field_name'];
+      
+      // Items imported from the D5 version are structured differently.
+      // Add in some of the values the program will be looking for.
+      if (!empty($field['module']) && empty($field['widget_module'])) {
+        
+        // The widget module is missig from D5 exports, try to guess it.
+        $bits = explode('_', $field['widget_type']);
+        $widget_module = $bits[0];
+        if (!module_exists($widget_module)) {
+          $widget_module = '';
+        }
+        $field['widget_module'] = $widget_module;
+        $imported_fields[$key]['widget_module'] = $widget_module;
+        
+        // Important!! The fields won't work unless we set these values.
+        $imported_fields[$key]['type'] = $field['field_type'];
+        $imported_fields[$key]['active'] = 1;
+        $imported_fields[$key]['widget_active'] = 1;
+        drupal_set_message(t('You are importing !field from a different version and some field values are missing. Edit and save this field after importing it to be sure the settings are correct.', array('!field' => $field['field_name'])));
+      }
+      else {
+        $not_enabled[] = $field['field_name'];
+      }
     }
-    else {
+    if (!empty($field['module'])) {
       if (!module_exists($field['module'])) {
         $not_enabled[] = $field['module'];
       }
-      if (!module_exists($field['widget_module'])) {
+      if (!empty($field['widget_module']) && !module_exists($field['widget_module'])) {
         $not_enabled[] = $field['widget_module'];
       }
     }

