Index: date_pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/date/date_pathauto.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 date_pathauto.inc
--- date_pathauto.inc	21 Feb 2007 17:15:01 -0000	1.1.2.5
+++ date_pathauto.inc	1 Apr 2007 21:13:16 -0000
@@ -67,7 +67,7 @@ function date_pathauto_node($op, $node =
       node_invoke_nodeapi($node, 'view', false, false);
 
       foreach (content_fields() as $field) {
-		if ($field['type'] == 'date' || $field['type'] == 'datestamp') {
+		if ($field['type'] == 'date' || $field['type'] == 'datestamp' && is_array($field['granularity'])) {
 		  // this could probably be done better
 		  $fieldname = $field['field_name'];
 		  $datefield = $node->$fieldname;
@@ -85,26 +85,27 @@ function date_pathauto_node($op, $node =
             date_convert_timezone($date, 'GMT', date_get_timezone($field['tz_handling'], $item['timezone']), 'local');
           }
 		  $iso = $date->local->iso;
-
-		  // we were using the date_iso_field calls, but we'd prefer 01 rather than 1 for january
-		  if (array_key_exists('Y', $field['granularity'])) {
+                  if (is_array($field['granularity'])) {
+		    // we were using the date_iso_field calls, but we'd prefer 01 rather than 1 for january
+		    if (array_key_exists('Y', $field['granularity'])) {
             $results['['. $field['field_name'] . '_y]'] = pathauto_cleanstring(substr($iso, 0, 4));
-		  }
-		  if (array_key_exists('M', $field['granularity'])) {
+		    }
+		    if (array_key_exists('M', $field['granularity'])) {
             $results['['. $field['field_name'] . '_m]'] = pathauto_cleanstring(substr($iso, 5, 2));
-		  }
-		  if (array_key_exists('D', $field['granularity'])) {
+		    }
+		    if (array_key_exists('D', $field['granularity'])) {
             $results['['. $field['field_name'] . '_d]'] = pathauto_cleanstring(substr($iso, 8, 2));
-		  }
-		  if (array_key_exists('H', $field['granularity'])) {
+		    }
+		    if (array_key_exists('H', $field['granularity'])) {
             $results['['. $field['field_name'] . '_h]'] = pathauto_cleanstring(substr($iso, 11, 2));
-		  }
-		  if (array_key_exists('N', $field['granularity'])) {
+		    }
+		    if (array_key_exists('N', $field['granularity'])) {
             $results['['. $field['field_name'] . '_n]'] = pathauto_cleanstring(substr($iso, 14, 2));
-		  }
-		  if (array_key_exists('S', $field['granularity'])) {
+		    }
+		    if (array_key_exists('S', $field['granularity'])) {
             $results['['. $field['field_name'] . '_s]'] = pathauto_cleanstring(substr($iso, 17, 2));
-		  }
+		    }
+                  }
 		}
       }
 
@@ -115,4 +116,4 @@ function date_pathauto_node($op, $node =
 	  break;
 
   }
-}
\ No newline at end of file
+}
Index: date_views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/date/date_views.inc,v
retrieving revision 1.22.2.12
diff -u -p -r1.22.2.12 date_views.inc
--- date_views.inc	21 Feb 2007 19:31:53 -0000	1.22.2.12
+++ date_views.inc	1 Apr 2007 21:13:17 -0000
@@ -155,7 +155,7 @@ function date_views_filter_handler($op, 
   $field   = $filterinfo['extra']['field'];
   $formats = date_get_formats($field);
   $db_info = content_database_info($field);
-  $value   = $db_info['columns']['value']['column'];
+  $column = $db_info['columns']['value']['column'];
   $table   = 'node_data_'. $field['field_name'];
   $offset  = date_views_offset($field) . ($filter['options'] ? " - ". intval($filter['options']) : '');
 
@@ -168,7 +168,7 @@ function date_views_filter_handler($op, 
       break;
   }
   $query->ensure_table($table);
-  $query->add_where(date_sql($type, $table .".". $value, $field_type, $offset) . $filter['operator'] . $date);
+  $query->add_where(date_sql($type, $table .".". $column, $field_type, $offset) . $filter['operator'] . $date);
 
 }
 
@@ -880,4 +880,4 @@ function theme_date_views_browser_full_v
   $output .= theme($display, $view, $nodes, $type, $teasers, $links);
 
   return $output;
-}
\ No newline at end of file
+}
