diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 143ff8754be2675ddaac809cc973ea3bc605468a..3744d693e2f542ff8b8716aebed8c4ace2dfc9e4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,8 @@ Feeds 6.x 1.0 xxxxx xx, 2010-xx-xx ---------------------------------- +- #648080 pvhee: FeedsNodeProcessor - static caching of mapping targets makes + mapping fail with multiple feed configurations. - #735444 Doug Preble: PubSubHubbub - Fix "Subscription refused by callback URL" with PHP 5.2.0. - alex_b: Suppress namespace warnings when parsing feeds for subscription in diff --git a/plugins/FeedsProcessor.inc b/plugins/FeedsProcessor.inc index 71a591d10e7399d309d70ebf7fdff38048bc2563..a95d074dd2688bc6d8d0797da9b49f2f1b3642ca 100644 --- a/plugins/FeedsProcessor.inc +++ b/plugins/FeedsProcessor.inc @@ -84,8 +84,8 @@ abstract class FeedsProcessor extends FeedsPlugin { // Static cache $targets as getMappingTargets() may be an expensive method. static $targets; - if (empty($targets)) { - $targets = $this->getMappingTargets(); + if (!isset($targets[$this->id])) { + $targets[$this->id] = $this->getMappingTargets(); } $parser = feeds_importer($this->id)->parser; if (empty($target_item)) { @@ -104,8 +104,8 @@ abstract class FeedsProcessor extends FeedsPlugin { foreach ($this->config['mappings'] as $mapping) { $value = $parser->getSourceElement($source_item, $mapping['source']); - if (is_array($targets[$mapping['target']]) && isset($targets[$mapping['target']]['callback']) && function_exists($targets[$mapping['target']]['callback'])) { - $callback = $targets[$mapping['target']]['callback']; + if (is_array($targets[$this->id][$mapping['target']]) && isset($targets[$this->id][$mapping['target']]['callback']) && function_exists($targets[$this->id][$mapping['target']]['callback'])) { + $callback = $targets[$this->id][$mapping['target']]['callback']; $callback($target_item, $mapping['target'], $value); } else {