--- /root/uc_gbase_orig/uc_gbase.module	2010-01-30 18:47:53.000000000 +0300
+++ /root/uc_gbase/uc_gbase.module	2010-03-11 18:39:58.000000000 +0300
@@ -222,7 +222,14 @@ if (isset($form['type']) && isset($form[
 
     $images_list = uc_gbase_get_images_list($form['field_image_cache']);
 
-    if ($form['type']['#value'] == 'product') {
+$res = db_query("SELECT type FROM {node_type} WHERE module = 'uc_product' OR module ='uc_product_kit'");
+$flag = 0;
+while($node_type = db_fetch_object($res)){
+	 if($form['type']['#value'] == $node_type->type)
+		$flag++;
+}	
+    if ($flag) {	
+//    if ($form['type']['#value'] == 'product') {
 
     $form['uc_gbase'] = array(
       '#type' => 'fieldset',
@@ -329,7 +336,7 @@ if (isset($form['type']) && isset($form[
     $form['uc_gbase']['product_condition'] = array(
       '#type' => 'radios',
       '#title' => 'Product Condition',
-      '#default_value' => isset($defaults['product_condition']) ? $defaults['product_condition'] : 0,
+      '#default_value' => isset($defaults['product_condition']) ? $defaults['product_condition'] : 1,
       '#options' => array(
         t('New'),
         t('Used'),
@@ -339,14 +346,14 @@ if (isset($form['type']) && isset($form[
     $form['uc_gbase']['payment_method'] = array(
       '#type' => 'checkboxes',
       '#title' => 'Payment Methods',
-      '#default_value' => isset($defaults['payment_method']) ? $defaults['payment_method'] : 0,
+      '#default_value' => isset($defaults['payment_method']) ? $defaults['payment_method'] : array(),
       '#options' => $payment_options,
     );
 
     $form['uc_gbase']['images'] = array(
       '#type' => 'checkboxes',
       '#title' => 'Images to submit',
-      '#default_value' => isset($defaults['images']) ? $defaults['images'] : 0,
+      '#default_value' => isset($defaults['images']) ? $defaults['images'] : array(),
       '#options' => $images_list,
     );
    }
@@ -482,7 +489,10 @@ function uc_gbase_get_images_list($form_
     global $base_url;
 
     $images = '';
-
+    
+    //TODO: this is a kludge to suppress warnings.  The data is not arriving here on save.
+    if(! is_array($form_image_fields))
+    	return array();
     foreach($form_image_fields as $image){
         $image_item = isset($image['#default_value'])? $image['#default_value'] : $image;
         if(strlen($image_item['filepath']) > 1 && !empty ($image_item['filepath']))
@@ -504,16 +514,17 @@ function _uc_gbase_insert_xml($node, $en
   
   $item->add_attribute('item_type', 'products');
 
-  $item->add_element('title', $uc_gbase['product_name'], 'text');
+  $item->add_element('title', $uc_gbase['product_name']?$uc_gbase['product_name']:$node->title, 'text');
   $item->add_element('content', htmlspecialchars($uc_gbase['product_description']) , 'text');
   $node_link = $item->xml->addChild('link');
   $node_link->addAttribute('href',$base_url.$node->path);
 
-  $item->add_element('updated', getdate());
+  //$item->add_element('updated', getdate());
   $item->add_element('summary', htmlspecialchars($uc_gbase['product_description']));
   
   $item->add_attribute('id', $node->nid);
-  $item->add_attribute('product_type', htmlspecialchars($uc_gbase['product_type']), 'text');
+//  $item->add_attribute('product_type', htmlspecialchars($uc_gbase['product_type']), 'text');
+  $item->add_attribute('product_type', htmlspecialchars($uc_gbase['product_type']));
   $item->add_attribute('price', $node->sell_price, 'floatUnit');
 
   $images = explode('$',$encoded_images);
@@ -533,9 +544,9 @@ function _uc_gbase_insert_xml($node, $en
   }
   if ($node->shippable) {
   $item->add_attribute('weight', $node->weight.' '.$node->weight_units);
-  $item->add_attribute('width', $node->width.' '.$node->length_units);
-  $item->add_attribute('length', $node->length.' '.$node->length_units);
-  $item->add_attribute('height', $node->height.' '.$node->length_units);
+  $item->add_attribute('width', sprintf("%01.2f", $node->width?$node->width:$node->dim_width).' '.$node->length_units);
+  $item->add_attribute('length', sprintf("%01.2f", $node->length?$node->length:$node->dim_length).' '.$node->length_units);
+  $item->add_attribute('height', sprintf("%01.2f", $node->height?$node->height:$node->dim_height).' '.$node->length_units);
   }
 
   $headers = uc_gbase_headers();
