=== modified file 'payment/uc_credit/uc_credit.module'
--- payment/uc_credit/uc_credit.module	2009-01-25 03:10:06 +0000
+++ payment/uc_credit/uc_credit.module	2009-02-02 22:39:21 +0000
@@ -227,7 +227,7 @@
   $args = explode('/', $_GET['q']);
 
   // Make sure sensitive checkout session data doesn't persist on other pages.
-  if ($args[1] != 'checkout' && isset($_SESSION['sescrd'])) {
+  if (isset($args[1]) && $args[1] != 'checkout' && isset($_SESSION['sescrd'])) {
     unset($_SESSION['sescrd']);
   }
 }

=== modified file 'uc_attribute/uc_attribute.module'
--- uc_attribute/uc_attribute.module	2009-01-30 20:04:51 +0000
+++ uc_attribute/uc_attribute.module	2009-02-02 22:39:22 +0000
@@ -239,7 +239,7 @@
 function uc_attribute_form_alter(&$form, &$form_state, $form_id) {
   if (strpos($form_id, 'add_to_cart_form') || strpos($form_id, 'add_product_form')) {
     // If the node has a product list, add attributes to them
-    if (count(element_children($form['products']))) {
+    if (isset($form['products']) && count(element_children($form['products']))) {
       foreach (element_children($form['products']) as $key) {
         $form['products'][$key]['attributes'] = _uc_attribute_alter_form(node_load($key));
         if (is_array($form['products'][$key]['attributes'])) {

=== modified file 'uc_catalog/uc_catalog.pages.inc'
--- uc_catalog/uc_catalog.pages.inc	2009-01-16 21:21:36 +0000
+++ uc_catalog/uc_catalog.pages.inc	2009-02-02 22:39:22 +0000
@@ -30,12 +30,12 @@
   $links = array();
   $child_list = array();
   foreach ($catalog->children as $child) {
-    if ($child->nodes) {
+    if (!empty($child->nodes)) {
       $links[] = array('title' => $child->name . (variable_get('uc_catalog_breadcrumb_nodecount', FALSE) ? ' ('. $child->nodes .')' : ''), 'href' => uc_catalog_path($child),
         'attributes' => array('rel' => 'tag'),
       );
     }
-    if ($child->image) {
+    if (!empty($child->image)) {
       $image = '<div>';
       if (module_exists('imagecache')) {
         $image .= l(theme('imagecache', 'uc_category', $child->image['filepath']), uc_catalog_path($child), array('html' => TRUE));
@@ -76,7 +76,7 @@
       $child_list[] = $cell_link;
     }
   }
-  if ($catalog->image) {
+  if (!empty($catalog->image)) {
     $output .= theme('imagecache', 'uc_thumbnail', $catalog->image['filepath'], $catalog->name, $catalog->name, array('class' => 'category'));
   }
 

=== modified file 'uc_order/uc_order.module'
--- uc_order/uc_order.module	2009-01-30 20:27:21 +0000
+++ uc_order/uc_order.module	2009-02-02 22:39:22 +0000
@@ -346,6 +346,7 @@
  * Implementation of hook_token_values(). (token.module)
  */
 function uc_order_token_values($type, $object = NULL) {
+  $values = array();
   switch ($type) {
     case 'order':
       $order = $object;
@@ -408,6 +409,7 @@
  * Implementation of hook_token_list(). (token.module)
  */
 function uc_order_token_list($type = 'all') {
+  $tokens = array();
   if ($type == 'order' || $type == 'ubercart' || $type == 'all') {
     $tokens['order']['new-username'] = t('New username associated with an order if applicable.');
     $tokens['order']['new-password'] = t('New password associated with an order if applicable.');

=== modified file 'uc_product/uc_product.admin.inc'
--- uc_product/uc_product.admin.inc	2009-01-19 19:41:59 +0000
+++ uc_product/uc_product.admin.inc	2009-02-02 22:39:22 +0000
@@ -10,6 +10,8 @@
  * List all products.
  */
 function uc_product_administration() {
+  $output = '';
+  
   $header = array();
   $tbl_columns = uc_product_table_header();
   foreach ($tbl_columns as $column) {
@@ -564,11 +566,15 @@
  * @see uc_product_class_form_submit()
  */
 function uc_product_class_form($form_state, $class = NULL) {
-  if ($class) {
-    drupal_set_title(check_plain($class->name));
+  if (!is_null($class)) {
+    $classname = $class->name;
+    $classdesc = $class->description;
+    drupal_set_title(check_plain($classname));
     $form['pcid'] = array('#type' => 'hidden', '#value' => $class->pcid);
   }
   else {
+    $classname = '';
+    $classdesc = '';
     $form['pcid'] = array('#type' => 'textfield',
       '#title' => t('Class ID'),
       '#required' => TRUE,
@@ -579,14 +585,14 @@
   $form['name'] = array(
     '#type' => 'textfield',
     '#title' => t('Class name'),
-    '#default_value' => $class->name,
+    '#default_value' => $classname,
     '#required' => TRUE,
   );
   $form['description'] = array(
     '#type' => 'textarea',
     '#title' => t('Description'),
     '#description' => t('This text describes the content type created for this product class to administrators.'),
-    '#default_value' => $class->description,
+    '#default_value' => $classdesc,
   );
   $form['submit'] = array(
     '#type' => 'submit',

=== modified file 'uc_product/uc_product.module'
--- uc_product/uc_product.module	2009-01-30 21:55:39 +0000
+++ uc_product/uc_product.module	2009-02-02 22:39:55 +0000
@@ -162,9 +162,10 @@
  */
 function uc_product_help($path, $arg) {
   // Do things here later. Figure out what you need to say for each section.
+  $output = '';
   switch ($path) {
     case 'admin/settings/module#description':
-      $output = t('Create products for sale in an online store.');
+      $output .= t('Create products for sale in an online store.');
       break;
     default:
       $output = '';
@@ -471,7 +472,7 @@
   $form['base']['model'] = array('#type' => 'textfield',
     '#title' => t('SKU'),
     '#required' => TRUE,
-    '#default_value' => $node->model,
+    '#default_value' => isset($node->model) ? $node->model : '',
     '#description' => t('Product SKU/model.'),
     '#weight' => 0,
     '#size' => 32,
@@ -486,7 +487,7 @@
     '#type' => 'textfield',
     '#title' => t('List price'),
     '#required' => FALSE,
-    '#default_value' => $node->list_price,
+    '#default_value' => isset($node->list_price) ? $node->list_price : 0,
     '#description' => t('The listed MSRP.'),
     '#weight' => 0,
     '#size' => 20,
@@ -498,7 +499,7 @@
     '#type' => 'textfield',
     '#title' => t('Cost'),
     '#required' => FALSE,
-    '#default_value' => $node->cost,
+    '#default_value' => isset($node->cost) ? $node->cost : 0,
     '#description' => t("Your store's cost."),
     '#weight' => 1,
     '#size' => 20,
@@ -510,7 +511,7 @@
     '#type' => 'textfield',
     '#title' => t('Sell price'),
     '#required' => TRUE,
-    '#default_value' => $node->sell_price,
+    '#default_value' => isset($node->sell_price) ? $node->sell_price : 0,
     '#description' => t('Customer purchase price.'),
     '#weight' => 2,
     '#size' => 20,
@@ -532,7 +533,7 @@
   );
   $form['base']['weight']['weight'] = array('#type' => 'textfield',
     '#title' => t('Weight'),
-    '#default_value' => $node->weight,
+    '#default_value' => isset($node->weight) ? $node->weight : 0,
     '#size' => 10,
     '#maxlength' => 15,
   );
@@ -544,7 +545,7 @@
   );
   $form['base']['weight']['weight_units'] = array('#type' => 'select',
     '#title' => t('Unit of measurement'),
-    '#default_value' => $node->weight_units ? $node->weight_units : variable_get('uc_weight_unit', 'lb'),
+    '#default_value' => isset($node->weight_units) ? $node->weight_units : variable_get('uc_weight_unit', 'lb'),
     '#options' => $units,
   );
   $form['base']['dimensions'] = array('#type' => 'fieldset',
@@ -561,32 +562,32 @@
       'cm' => t('Centimeters'),
       'mm' => t('Millimeters'),
     ),
-    '#default_value' => $node->length_units ? $node->length_units : variable_get('uc_length_unit', 'in'),
+    '#default_value' => isset($node->length_units) ? $node->length_units : variable_get('uc_length_unit', 'in'),
   );
   $form['base']['dimensions']['length'] = array('#type' => 'textfield',
     '#title' => t('Length'),
-    '#default_value' => $node->length,
+    '#default_value' => isset($node->length) ? $node->length : '',
     '#size' => 10,
   );
   $form['base']['dimensions']['width'] = array('#type' => 'textfield',
     '#title' => t('Width'),
-    '#default_value' => $node->width,
+    '#default_value' => isset($node->width) ? $node->width : '',
     '#size' => 10,
   );
   $form['base']['dimensions']['height'] = array('#type' => 'textfield',
     '#title' => t('Height'),
-    '#default_value' => $node->height,
+    '#default_value' => isset($node->height) ? $node->height : '',
     '#size' => 10,
   );
   $form['base']['pkg_qty'] = array('#type' => 'textfield',
     '#title' => t('Package quantity'),
-    '#default_value' => $node->pkg_qty ? $node->pkg_qty : 1,
+    '#default_value' => isset($node->pkg_qty) ? $node->pkg_qty : 1,
     '#description' => t('For a package containing only this product, how many are in it?'),
     '#weight' => 25,
   );
   $form['base']['default_qty'] = array('#type' => 'textfield',
     '#title' => t('Default quantity to add to cart'),
-    '#default_value' => !is_null($node->default_qty) ? $node->default_qty : 1,
+    '#default_value' => isset($node->default_qty) ? $node->default_qty : 1,
     '#description' => t('Leave blank or zero to disable the quantity field next to the add to cart button, if it is enabled <a href="!settings_url">in general</a>. If it is disabled, this field is ignored.', array('!settings_url' => url('admin/store/settings/products/edit'))),
     '#weight' => 27,
     '#size' => 5,
@@ -705,12 +706,7 @@
   db_query("DELETE from {uc_products} WHERE nid = %d", $node->nid);
 }
 
-/**
- * Implementation of hook_view().
- */
-function uc_product_view($node, $teaser = 0, $page = 0) {
-  $node = node_prepare($node, $teaser);
-
+function uc_product_field_enabled() {
   $enabled = variable_get('uc_product_field_enabled', array(
     'image' => 1,
     'display_price' => 1,
@@ -722,6 +718,16 @@
     'dimensions' => 0,
     'add_to_cart' => 1,
   ));
+  return $enabled;
+}
+
+/**
+ * Implementation of hook_view().
+ */
+function uc_product_view($node, $teaser = 0, $page = 0) {
+  $node = node_prepare($node, $teaser);
+
+  $enabled = uc_product_field_enabled();
   $weight = variable_get('uc_product_field_weight', array(
     'image' => -2,
     'display_price' => -1,
@@ -1156,9 +1162,10 @@
  ******************************************************************************/
 
 function uc_product_table_header() {
+  $enabled = uc_product_field_enabled();
   $columns = array();
 
-  if (module_exists('imagecache')) {
+  if (module_exists('imagecache') && $enabled['image']) {
     $columns['image'] = array(
       'weight' => -5,
       'cell' => array('data' => t('Image')),
@@ -1168,16 +1175,22 @@
     'weight' => 0,
     'cell' => array('data' => t('Name'), 'field' => 'n.title'),
   );
-  $columns['list_price'] = array(
-    'weight' => 3,
-    'access' => arg(0) == 'admin',
-    'cell' => array('data' => t('List price'), 'field' => 'p.list_price'),
-  );
-  $columns['price'] = array(
-    'weight' => 5,
-    'cell' => array('data' => t('Price'), 'field' => 'p.sell_price'),
-  );
-  if (module_exists('uc_cart') && (arg(0) != 'admin' || $_GET['q'] == 'admin/store/settings/tables/uc_product_table')) {
+  
+  if ($enabled['list_price']) {
+    $columns['list_price'] = array(
+      'weight' => 3,
+      'cell' => array('data' => t('List price'), 'field' => 'p.list_price'),
+    );
+  }
+
+  if ($enabled['sell_price']) {
+    $columns['price'] = array(
+      'weight' => 5,
+      'cell' => array('data' => t('Price'), 'field' => 'p.sell_price'),
+    );
+  }
+
+  if (module_exists('uc_cart') && (arg(0) != 'admin' || $_GET['q'] == 'admin/store/settings/tables/uc_product_table') && $enabled['add_to_cart']) {
     $columns['add_to_cart'] = array(
       'weight' => 10,
       'cell' => array('data' => t('Add to cart'), 'nowrap' => 'nowrap'),
@@ -1193,6 +1206,7 @@
  * Display image, name, price, and add to cart form.
  */
 function uc_product_table($args = array()) {
+  $enabled = uc_product_field_enabled();
   $table = array(
     '#type' => 'tapir_table',
     '#attributes' => array(
@@ -1205,22 +1219,29 @@
   foreach ($args as $nid) {
     $data = array();
     $node = node_load($nid);
-    if (module_exists('imagecache')) {
-      if (($field = variable_get('uc_image_'. $node->type, '')) && isset($node->$field) && file_exists($node->{$field}[0]['filepath'])) {
-        $image = $node->{$field}[0];
-        $data['image'] = array('#value' => l(theme('imagecache', 'product_list', $image['filepath'], $image['alt'], $image['title']), 'node/'. $node->nid, array('html' => TRUE)));
-      }
-      else {
-        $data['image'] = array('#value' => t('n/a'));
+    if ($enabled['image']) {
+      if (module_exists('imagecache')) {
+        if (($field = variable_get('uc_image_'. $node->type, '')) && isset($node->$field) && file_exists($node->{$field}[0]['filepath'])) {
+          $image = $node->{$field}[0];
+          $data['image'] = array('#value' => l(theme('imagecache', 'product_list', $image['filepath'], $image['alt'], $image['title']), 'node/'. $node->nid, array('html' => TRUE)));
+        }
+        else {
+          $data['image'] = array('#value' => t('n/a'));
+        }
       }
     }
     $data['name'] = array(
       '#value' => l($node->title, 'node/'. $node->nid),
       '#cell_attributes' => array('width' => '100%'),
     );
-    $data['list_price'] = array('#value' => uc_currency_format($node->list_price), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
-    $data['price'] = array('#value' => theme('uc_product_sell_price', $node->sell_price, TRUE), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
-    if (module_exists('uc_cart') && arg(0) != 'admin') {
+    if ($enabled['list_price']) {
+      $data['list_price'] = array('#value' => uc_currency_format($node->list_price), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
+    }
+    if ($enabled['sell_price']) {
+      $data['price'] = array('#value' => theme('uc_product_sell_price', $node->sell_price, TRUE), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
+    }
+    
+    if (module_exists('uc_cart') && arg(0) != 'admin' && $enabled['add_to_cart']) {
       $data['add_to_cart'] = array('#value' => drupal_get_form('uc_catalog_buy_it_now_form_'. $node->nid, $node));
     }
     $table[] = $data;
@@ -1443,8 +1464,10 @@
   // Get the current product image widget.
   $image_widget = uc_product_get_image_widget();
   $image_widget_func = $image_widget['callback'];
+  $image_defaults = array('filepath' => '','alt' => '','title' => '');
 
-  $first = array_shift($images);
+  $first = array_merge($image_defaults, array_shift($images));
+  
   $output = '<div class="product-image">';
   if ($image_widget) {
     $output .= '<a href="'. check_url(file_create_url($first['filepath'])) .'" title="'. $first['title'] .'"'. $image_widget_func($rel_count) .'>';
@@ -1458,6 +1481,7 @@
   }
   $output .= '<br />';
   foreach ($images as $thumbnail) {
+    $thumbnail = array_merge($image_defaults, $thumbnail);
     if ($image_widget) {
       $output .= '<a href="'. check_url(file_create_url($thumbnail['filepath'])) .'" title="'. $thumbnail['title'] .'"'. $image_widget_func($rel_count) .'>';
     }

=== modified file 'uc_store/includes/tapir.inc'
--- uc_store/includes/tapir.inc	2008-12-01 20:07:55 +0000
+++ uc_store/includes/tapir.inc	2009-02-02 22:39:22 +0000
@@ -51,7 +51,7 @@
       $element['#rows'][$row][$col_id] = $element[$row][$col_id];
       unset($element[$row][$col_id]);
     }
-    $element['#rows'][$row]['#attributes'] = $element[$row]['#attributes'];
+    $element['#rows'][$row]['#attributes'] = isset($element[$row]['#attributes']) ? $element[$row]['#attributes'] : array();
   }
 
   return $element;
@@ -76,7 +76,7 @@
   // Loop through the columns and create the header array.
   foreach ($element['#columns'] as $col_id => $col_data) {
     // Add the cell if available.
-    if ($col_data['access'] !== FALSE) {
+    if (!isset($col_data['access']) || $col_data['access'] !== FALSE) {
       $header[] = $col_data['cell'];
     }
   }
@@ -100,9 +100,9 @@
     // Loop through each column in the header.
     foreach ($element['#columns'] as $col_id => $col_data) {
       // If this row defines cell data for the current column...
-      if ($col_data['access'] !== FALSE && isset($data[$col_id])) {
+      if ((!isset($col_data['access']) || $col_data['access'] !== FALSE) && isset($data[$col_id])) {
         $cell = array();
-        if (is_array($data[$col_id]['#cell_attributes'])) {
+        if (isset($data[$col_id]['#cell_attributes']) && is_array($data[$col_id]['#cell_attributes'])) {
           foreach ($data[$col_id]['#cell_attributes'] as $property => $value) {
             if ($property == 'colspan' && $value == 'full') {
               // Extend full-width cells to the number of columns actually
@@ -129,7 +129,7 @@
   }
 
   // Return the rendered table.
-  return theme('table', $header, $rows, (array)$element['#attributes'], $element['#title']) . $element['#children'];
+  return theme('table', $header, $rows, (array)$element['#attributes'], $element['#title']) . (isset($element['#children']) ? $element['#children'] : '');
 }
 
 /**

=== modified file 'uc_store/uc_store.module'
--- uc_store/uc_store.module	2009-01-27 18:10:23 +0000
+++ uc_store/uc_store.module	2009-02-02 22:39:22 +0000
@@ -806,6 +806,9 @@
   if ($value < 0) {
     $value = abs($value);
     $format = '-';
+  } 
+  else {
+    $format = '';
   }
 
   if ($sign && !variable_get('uc_sign_after_amount', FALSE)) {

