--- simplefeed_item.module.old	2007-06-01 11:40:14.000000000 -0400
+++ simplefeed_item.module	2007-06-01 11:49:55.000000000 -0400
@@ -380,19 +380,28 @@ function simplefeed_item_feed_parse($pro
         // add any categories set by this feed to the Drupal specific ones
         if (variable_get('simplefeed_categories', 0)) {           
           if ($item->get_categories()) {
-            $process_feed->tags .= ', '. implode($item->get_categories(), ', ');
+             $tags =  $process_feed->tags .', '. implode($item->get_categories(), ', ');
           }
         }   
 
         // add any tags (either inheriting from parent feed or from parsing the feed item) to the feed item node
-        if ($process_feed->vocab) {
-          $item->taxonomy['tags'][$process_feed->vocab] = decode_entities($process_feed->tags); 
+        if ($process_feed->vocab) { 
+           $cache_item->taxonomy['tags'][$process_feed->vocab] = decode_entities($tags);
         }
 
         // add in default feed expiration date inherited from parent feed
-        $item->feed_expires = $process_feed->expires;
-        $item->parent_feed_link = $feed->get_link();
-        db_query("INSERT INTO {simplefeed_feed_item_cache} (data, fid, url) VALUES (%b, %d, '%s')", serialize($item), $process_feed->nid, $item->get_permalink());
+        $cache_item->feed_expires = $process_feed->expires;
+        $cache_item->parent_feed_link = $feed->get_link();
+        
+        // load cache data into temporary item
+        $cache_item->title = $item->get_title();
+        $cache_item->fid = $item->fid;
+        $cache_item->date = $item->get_date();
+        $cache_item->fdate = $item->get_date('Y-m-d H:i:s O');
+        $cache_item->description = $item->get_description();
+        $cache_item->permalink = $item->get_permalink();
+     
+        db_query("INSERT INTO {simplefeed_feed_item_cache} (data, fid, url) VALUES (%b, %d, '%s')", serialize($cache_item), $process_feed->nid, $item->get_permalink());
       }
     }    
   }
@@ -411,17 +420,17 @@ function simplefeed_item_feed_save($feed
     $item = unserialize($feed_item->data);
     $node = array('type' => 'feed_item');      
     // this strips out any tags that may appear as <b> in the title, and makes sure &quot; -> " for display                                     
-    $values['title'] = decode_entities(strip_tags($item->get_title()));        
-    if ($item->get_date()) {
+    $values['title'] = decode_entities(strip_tags($item->title));        
+    if ($item->date) {
       // "created" is a node property, however we have to use "date" to set this with drupal_execute since it is the form element name
       // we pass in 'Y-m-d H:i:s O' to $item->get_date() since PHP4 can't strtotime() the default SimplePie date
-      $values['date'] = format_date(strtotime($item->get_date('Y-m-d H:i:s O')), 'custom', 'Y-m-d H:i:s O');  
+      $values['date'] = format_date(strtotime($item->fdate), 'custom', 'Y-m-d H:i:s O');  
     }
     $values['name'] = db_result(db_query('SELECT u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE nid = %d', $feed_item->fid));
     $values['format'] = variable_get('simplefeed_format', 1);
-    $values['body'] = $item->get_description();            
+    $values['body'] = decode_entities($item->description);
     $values['expires'] = $item->feed_expires;  
-    $values['url'] = $item->get_permalink() != '' ? $item->get_permalink() : $item->parent_feed_link;                                                                                
+    $values['url'] = $item->permalink != '' ? $item->permalink : $item->parent_feed_link;                                                                                
     $values['fid'] = $feed_item->fid;
     $values['taxonomy'] = $item->taxonomy;                     
 
