? 712304-15.patch
Index: feeds.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/feeds/feeds.install,v
retrieving revision 1.7
diff -u -p -r1.7 feeds.install
--- feeds.install	23 Feb 2010 04:59:06 -0000	1.7
+++ feeds.install	17 May 2010 00:54:07 -0000
@@ -75,7 +75,6 @@ function feeds_schema() {
         'size' => 'big',
         'not null' => FALSE,
         'description' => t('Cache for batching.'),
-        'serialize' => TRUE,
       ),
     ),
     'primary key' => array('id', 'feed_nid'),
@@ -492,3 +491,19 @@ function feeds_update_6009() {
   db_create_table($ret, 'feeds_push_subscriptions', $table);
   return $ret;
 }
+
+/**
+ * Make batch field not serialized.
+ */
+function feeds_update_6010() {
+  $ret = array();
+  $spec = array(
+    'type' => 'text',
+    'size' => 'big',
+    'not null' => FALSE,
+    'description' => t('Cache for batching.'),
+    'serialize' => TRUE,
+  );
+  db_change_field($ret, 'feeds_source', 'batch', 'batch', $spec);
+  return $ret;
+}
Index: includes/FeedsBatch.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/feeds/includes/FeedsBatch.inc,v
retrieving revision 1.11
diff -u -p -r1.11 FeedsBatch.inc
--- includes/FeedsBatch.inc	16 May 2010 20:28:33 -0000	1.11
+++ includes/FeedsBatch.inc	17 May 2010 00:54:07 -0000
@@ -16,11 +16,14 @@ class FeedsBatch {
   public $updated;
   // Number of items deleted.
   public $deleted;
+  public $processed;
+
   public function __construct() {
     $this->total = 0;
     $this->created = 0;
     $this->updated = 0;
     $this->deleted = 0;
+    $this->processed = 0;
   }
 }
 
Index: includes/FeedsSource.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/feeds/includes/FeedsSource.inc,v
retrieving revision 1.12
diff -u -p -r1.12 FeedsSource.inc
--- includes/FeedsSource.inc	30 Mar 2010 20:06:36 -0000	1.12
+++ includes/FeedsSource.inc	17 May 2010 00:54:07 -0000
@@ -195,7 +195,8 @@ class FeedsSource extends FeedsConfigura
       'feed_nid' => $this->feed_nid,
       'config' => $config,
       'source' => $source,
-      'batch' => isset($this->batch) ? $this->batch : FALSE,
+      // Use base64 encoding to support protected class members.
+      'batch' => base64_encode(serialize(isset($this->batch) ? $this->batch : FALSE)),
     );
     // Make sure a source record is present at all time, try to update first,
     // then insert.
@@ -217,7 +218,7 @@ class FeedsSource extends FeedsConfigura
       ctools_include('export');
       $this->export_type = EXPORT_IN_DATABASE;
       $this->config = unserialize($record->config);
-      $this->batch = unserialize($record->batch);
+      $this->batch = unserialize(base64_decode($record->batch));
     }
   }
 
Index: plugins/FeedsNodeProcessor.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/feeds/plugins/FeedsNodeProcessor.inc,v
retrieving revision 1.34
diff -u -p -r1.34 FeedsNodeProcessor.inc
--- plugins/FeedsNodeProcessor.inc	16 May 2010 21:24:50 -0000	1.34
+++ plugins/FeedsNodeProcessor.inc	17 May 2010 00:54:08 -0000
@@ -80,8 +80,10 @@ class FeedsNodeProcessor extends FeedsPr
       }
 
       $processed++;
+      $batch->processed++;
+
       if ($processed >= variable_get('feeds_node_batch_size', FEEDS_NODE_BATCH_SIZE)) {
-        return (1.0 / ($batch->total + 1)) * ($batch->updated + $batch->created); // Add + 1 to make sure that result is not 1.0 = finished.
+        return (1.0 / ($batch->total + 1)) * $batch->processed; // Add + 1 to make sure that result is not 1.0 = finished.
       }
     }
 
