Index: googlebase.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/googlebase/googlebase.admin.inc,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 googlebase.admin.inc
--- googlebase.admin.inc	5 Mar 2010 02:06:44 -0000	1.4.2.2
+++ googlebase.admin.inc	29 Sep 2010 11:48:21 -0000
@@ -51,6 +51,12 @@ function googlebase_admin_settings_form(
     '#collapsible' => TRUE,
     '#collapsed' => FALSE,
   );
+  $form['settings']['googlebase_dry_run'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Dry run mode'),
+    '#default_value' => variable_get('googlebase_dry_run', FALSE),
+    '#description' => t('Check this box to test your feed without committing any data to Google Base.')
+  );
   $form['settings']['googlebase_cron_limit'] = array(
     '#type' => 'select',
     '#title' => t('Number of items to submit per cron run'),
Index: googlebase.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/googlebase/googlebase.module,v
retrieving revision 1.29.2.5
diff -u -p -r1.29.2.5 googlebase.module
--- googlebase.module	5 Mar 2010 02:02:21 -0000	1.29.2.5
+++ googlebase.module	29 Sep 2010 11:48:22 -0000
@@ -280,13 +280,11 @@ function googlebase_build_entry($node, g
   $item->add_namespaced_element('g', 'link', url('node/' . $node->nid, array('absolute' => TRUE)), array('type' => 'url'));
   $item->add_element('content', check_plain($node->teaser), array('type' => 'html'));
 
-  $type = content_types($node->type);
-
   // Set item type. Default to content type.
-  $type_name = $type['name'];
+  $type_name = node_get_types('name', $node);
   drupal_alter('googlebase_item_type', $type_name);
   if (!is_string($type_name)) {
-    $type_name = $type['name'];
+    $type_name = node_get_types('name', $node);
   }
   $item->add_namespaced_element('g', 'item_type', check_plain($type_name), array('type' => 'text'));
 
@@ -299,24 +297,27 @@ function googlebase_build_entry($node, g
   // Custom attributes:
   // * http://base.google.com/support/bin/answer.py?answer=59558&hl=en
   // * http://code.google.com/apis/base/docs/2.0/reference.html#AttributesFeed
-  $mapping = googlebase_cck_mapping();
-  drupal_alter('googlebase_cck_fields', $mapping);
-
-  foreach($type['fields'] as $field) {
-    $data = array();
-    $handler_name = NULL;
-    if (isset($mapping['per-field'][$field['field_name']])) {
-      $handler_name = $mapping['per-field'][$field['field_name']];
-    }
-    elseif (isset($mapping[$field['type']][$field['widget']['type']])) {
-      $handler_name = $mapping[$field['type']][$field['widget']['type']];
-    }
-    if (!empty($handler_name) && class_exists($handler_name, TRUE)) {
-      $handler = new $handler_name($field, $node->{$field['field_name']});
-      if (!empty($handler->values) && !empty($handler->type) && !empty($handler->name) && is_array($handler->values)) {
-        foreach ($handler->values as $value) {
-          if ($value != '') {
-            $item->add_namespaced_element('g', $handler->name, check_plain($value), array('type' => $handler->type));
+  if (module_exists('content')) {
+    $mapping = googlebase_cck_mapping();
+    drupal_alter('googlebase_cck_fields', $mapping);
+
+    $type = content_types($node->type);
+    foreach ($type['fields'] as $field) {
+      $data = array();
+      $handler_name = NULL;
+      if (isset($mapping['per-field'][$field['field_name']])) {
+        $handler_name = $mapping['per-field'][$field['field_name']];
+      }
+      elseif (isset($mapping[$field['type']][$field['widget']['type']])) {
+        $handler_name = $mapping[$field['type']][$field['widget']['type']];
+      }
+      if (!empty($handler_name) && class_exists($handler_name, TRUE)) {
+        $handler = new $handler_name($field, $node->{$field['field_name']});
+        if (!empty($handler->values) && !empty($handler->type) && !empty($handler->name) && is_array($handler->values)) {
+          foreach ($handler->values as $value) {
+            if ($value != '') {
+              $item->add_namespaced_element('g', $handler->name, check_plain($value), array('type' => $handler->type));
+            }
           }
         }
       }
@@ -526,6 +527,10 @@ function googlebase_get_types() {
  * Implementation of hook_cron().
  */
 function googlebase_cron() {
+  if (variable_get('googlebase_dry_run', FALSE)) {
+    return;
+  }
+ 
   $types = implode("','", array_keys(googlebase_get_types()));
   $limit = variable_get('googlebase_cron_limit', 20);
 
Index: includes/googlebase_batch.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/googlebase/includes/googlebase_batch.inc,v
retrieving revision 1.6.2.1
diff -u -p -r1.6.2.1 googlebase_batch.inc
--- includes/googlebase_batch.inc	5 Mar 2010 01:57:08 -0000	1.6.2.1
+++ includes/googlebase_batch.inc	29 Sep 2010 11:48:22 -0000
@@ -128,7 +128,7 @@ class googlebase_batch extends googlebas
           $messages[] = t("@reason\n", array('@reason' => (string) $error['reason']));
         }
       }
-      $message = t("Error !code: !reason", array('!code' => $code, '!reason' => $reason)) . theme_item_list($messages) . "<br/><pre>" . check_plain(var_dump($this->response)) . "</pre>";
+      $message = t("Error !code: !reason", array('!code' => $code, '!reason' => $reason)) . theme('item_list', $messages) . "<br/><pre>" . check_plain(print_r($this->response, TRUE)) . "</pre>";
       watchdog('googlebase', $message, NULL, WATCHDOG_ERROR);
     } catch (Exception $e) {
       watchdog('googlebase', t('There was an error communicating with Google Base.'));
Index: includes/googlebase_item.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/googlebase/includes/googlebase_item.inc,v
retrieving revision 1.6
diff -u -p -r1.6 googlebase_item.inc
--- includes/googlebase_item.inc	5 Dec 2009 04:33:33 -0000	1.6
+++ includes/googlebase_item.inc	29 Sep 2010 11:48:22 -0000
@@ -34,7 +34,11 @@ class googlebase_item extends googlebase
       $items_feed_url .= '/' . $this->node->googlebase_id;
       $method = 'PUT';
     }
-    
+
+    if (variable_get('googlebase_dry_run', FALSE)) {
+      $items_feed_url .= '?dry-run=true';
+    }
+
     // Execute request
     $result = drupal_http_request($items_feed_url, $headers, $method, $this->get_xml());
 
@@ -44,6 +48,9 @@ class googlebase_item extends googlebase
     elseif (($result->code == '200' || $result->code == '201') && !empty($result->headers['Location'])) {
       // Item was successfully added or updated
       // Return ID assigned by Google Base
+      if (variable_get('googlebase_dry_run', FALSE)) {
+        drupal_set_message(t('Google Base dry run was successful.'));
+      }
       return substr(strrchr($result->headers['Location'], '/'), 1);
     }
     elseif ($result->code == '404') {
@@ -52,7 +59,7 @@ class googlebase_item extends googlebase
         // Re-insert the item.
         googlebase_delete($this->node->nid);
         unset($this->node->googlebase_id);
-        return $this->insert();
+        return $this->insert($this->node);
       }
     }
     if (user_access('administer google base')) {
