diff U5 category.install category.install
--- category.install	Thu Jan 15 04:13:20 1970
+++ category.install	Thu Jan 15 04:13:20 1970
@@ -330,10 +330,17 @@
         'not null' => TRUE,
         'default' => 0,
         'size' => 'tiny',
         'description' => 'Whether or not free tagging is enabled for the container. (0 = disabled, 1 = enabled)',
       ),
+      'freetag_node_type' => array(
+       'type' => 'varchar',
+       'length' => 32,
+       'not null' => TRUE,
+       'default' => 'category_cat',
+       'description' => 'The type of node to create on free tagging.',
+      ),
       'hidden_cont' => array(
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
@@ -555,7 +562,11 @@
     'indexes' => array('expire' => array('expire')),
     'primary key' => array('cid'),
   );
 
   db_create_table($ret, 'cache_category', $schema);
+  return $ret;
+}
+function category_update_6004() {
+  $ret[] = update_sql("ALTER TABLE {category_cont} ADD freetag_node_type varchar(32) NOT NULL default 'category_cat' AFTER tags");
   return $ret;
 }
diff U5 category.module category.module
--- category.module	Thu Jan 15 04:13:20 1970
+++ category.module	Thu Jan 15 04:13:20 1970
@@ -744,10 +744,12 @@
 /**
  * Save category associations for a given node.
  */
 function category_node_save($node, $categories) {
   global $user;
+  global $category_last_update_nid;
+
 
   category_node_delete_revision($node);
 
   // Free tagging containers do not send their cids in the form,
   // so we'll detect them here and process them independently.
@@ -769,13 +771,14 @@
             $typed_cat_cid = $possibility->cid;
           }
         }
 
         if (!$typed_cat_cid) {
+          $container = node_load($cnid);       
           $tag_node = new stdClass();
           $tag_node->title = $typed_cat;
-          $tag_node->type = 'category';
+          $tag_node->type = $container->category['freetag_node_type'];
           $tag_node->category['cnid'] = $cnid;
           $tag_node->category['parents'][0] = $cnid;
           $node_options = variable_get('node_options_'. $tag_node->type, array('status', 'promote'));
           $tag_node->status = in_array('status', $node_options);
           $tag_node->promote = in_array('promote', $node_options);
@@ -784,10 +787,11 @@
           $tag_node->name = $user->name ? $user->name : 0;
           $tag_node->date = date('j M Y H:i:s');
           $tag_node = node_submit($tag_node);
           node_save($tag_node);
           $typed_cat_cid = $tag_node->nid;
+          $freetag_callback_nid = 0;
         }
 
         // Defend against duplicate, differently cased tags
         if (!isset($inserted[$typed_cat_cid])) {
           db_query('INSERT INTO {category_node} (nid, vid, cid) VALUES (%d, %d, %d)', $node->nid, $node->vid, $typed_cat_cid);
@@ -838,11 +842,11 @@
  * Implementation of hook_node_type().
  */
 function category_node_type($op, $info) {
   if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
     db_query("UPDATE {category_cont_node_types} SET type = '%s' WHERE type = '%s'", $info->type, $info->old_type);
-
+    db_query("UPDATE {category_cont} SET freetag_node_type = '%s' WHERE freetag_node_type = '%s'", $info->type, $info->old_type);
     $allowed_containers = variable_get('category_allowed_containers_'. $info->old_type, array());
     variable_del('category_allowed_containers_'. $info->old_type);
     if (!empty($allowed_containers)) {
       variable_set('category_allowed_containers_'. $info->type, $allowed_containers);
     }
@@ -852,10 +856,11 @@
     if (!empty($behavior)) {
       variable_set('category_behavior_'. $info->type, $behavior);
     }
   }
   elseif ($op == 'delete') {
+    db_query("UPDATE {category_cont} SET freetag_node_type = '%s' WHERE freetag_node_type = '%s'", 'category_cat', $info->type);
     db_query("DELETE FROM {category_cont_node_types} WHERE type = '%s'", $info->type);
     variable_del('category_allowed_containers_'. $info->type);
     variable_del('category_behavior_'. $info->type);
   }
 }
@@ -1506,10 +1511,11 @@
       '#weight' => 15,
       '#description' => t('Make this container \'hidden\'. A hidden container exists within a category hierarchy, but is invisible to end-users. For example, a hidden container does not have a menu item generated by category_menu, and it is not shown in navigational elements provided by category_display. This hidden behaviour applies only to the container itself, not to its child categories or to their assigned nodes.'),
     );
     $form['category']['hierarchy']['#collapsed'] = TRUE;
   }
+  
   $form['category']['hierarchy']['depth'] = array(
     '#type' => 'select',
     '#title' => t('Depth'),
     '#default_value' => $node->category['depth'],
     '#options' => _category_form_depth_options(10),
@@ -1565,10 +1571,18 @@
       '#type' => 'checkbox',
       '#title' => t('Tags'),
       '#default_value' => $node->category['tags'],
       '#description' => t('Categories in this container are created by users when submitting posts by typing a comma separated list.'),
     );
+    $form['category']['tagging']['freetag_node_type'] = array(
+      '#type' => 'select',
+      '#title' => t('Freetagging content type'),
+      '#default_value' => isset($node->category['freetag_node_type']) ? $node->category['freetag_node_type'] : 'category_cat',
+      '#options' => _category_node_type_options(),
+      '#description' => t('Choose the content type to use when creating new freetagging categories.'),
+      '#required' => TRUE,
+    );
     $form['category']['tagging']['multiple'] = array(
       '#type' => 'checkbox',
       '#title' => t('Multiple select'),
       '#default_value' => $node->category['multiple'],
       '#description' => t('Allows posts to have more than one category from this container (always true for tags).'),
@@ -1625,10 +1639,22 @@
       '#default_value' => implode("\n", category_get_synonyms($node->category['cid'])),
       '#description' => t('Synonyms of this category, one synonym per line.'),
     );
     $form['#submit'][] = 'category_form_category_submit';
   }
+}
+function _category_node_type_options() {
+  $types = node_get_types();
+  $options = array();
+
+  foreach (node_get_types() as $type) {
+    $behavior = variable_get('category_behavior_'. $type->type, 0);
+    if (!empty($behavior) && $behavior == 'category') {
+      $options[$type->type] = $type->name;
+    }
+  }
+  return $options;
 }
 
 /**
  * Submit handler to insert or update a category. Updates the
  * hierarchy setting for the container of the category being updated.
