From 893f9648ea5061695a51c7ba26759ef8accb0606 Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Tue, 27 Jul 2010 18:39:11 +0000 Subject: [PATCH] #836090 andrewlevine, alex_b: Include mapping configuration in hash. --- CHANGELOG.txt | 1 + plugins/FeedsNodeProcessor.inc | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c7f75b74..a02516b4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ Feeds 6.x 1.0 XXXXXXXXXXXXXXXXXX -------------------------------- +- #836090 andrewlevine, alex_b: Include mapping configuration in hash. - #853156 alex_b: Support real updates of terms. - #858684 alex_b: Fix notices when file not found. diff --git a/plugins/FeedsNodeProcessor.inc b/plugins/FeedsNodeProcessor.inc index 8d7dfc24..adaf74cb 100644 --- a/plugins/FeedsNodeProcessor.inc +++ b/plugins/FeedsNodeProcessor.inc @@ -361,13 +361,21 @@ class FeedsNodeProcessor extends FeedsProcessor { } /** - * Create MD5 hash of $item array. + * Create MD5 hash of item and mappings array. + * + * Include mappings as a change in mappings may have an affect on the item + * produced. + * * @return Always returns a hash, even with empty, NULL, FALSE: * Empty arrays return 40cd750bba9870f18aada2478b24840a * Empty/NULL/FALSE strings return d41d8cd98f00b204e9800998ecf8427e */ protected function hash($item) { - return hash('md5', serialize($item)); + static $serialized_mappings; + if (!$serialized_mappings) { + $serialized_mappings = serialize($this->config['mappings']); + } + return hash('md5', serialize($item) . $serialized_mappings); } /** -- GitLab