From 0b40f2a0c4a0b39c75a32582f48ee6505864a788 Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Sun, 16 May 2010 20:20:58 +0000 Subject: [PATCH] #760140 lyricnz: FeedsBatch->total not updated when addItem() is called. --- CHANGELOG.txt | 1 + includes/FeedsBatch.inc | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a7307ef7..fec00b3d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx ---------------------------------- +- #760140 lyricnz: FeedsBatch->total not updated when addItem($item) is called. - #755544 Monkey Master: Keep batch processing when mapping fails. - alex_b: Reset import schedule after deleting items from feed. - #653412 rbrandon: Do not create items older than expiry time. diff --git a/includes/FeedsBatch.inc b/includes/FeedsBatch.inc index 4860f89f..adffa5c8 100644 --- a/includes/FeedsBatch.inc +++ b/includes/FeedsBatch.inc @@ -133,7 +133,9 @@ class FeedsImportBatch extends FeedsBatch { * removed from the internal array. */ public function shiftItem() { - return array_shift($this->items); + $item = array_shift($this->items); + $this->total = count($this->items); + return $item; } /** @@ -165,7 +167,7 @@ class FeedsImportBatch extends FeedsBatch { */ public function setItems($items) { $this->items = $items; - $this->total = count($items); + $this->total = count($this->items); } /** @@ -173,5 +175,6 @@ class FeedsImportBatch extends FeedsBatch { */ public function addItem($item) { $this->items[] = $item; + $this->total = count($this->items); } } -- GitLab