Index: plugins/FeedsParser.inc =================================================================== --- plugins/FeedsParser.inc (revision 77) +++ plugins/FeedsParser.inc (working copy) @@ -131,7 +131,7 @@ return $node->uid; } $item = $result->currentItem(); - return isset($item[$element_key]) ? $item[$element_key] : ''; + return !empty($item[$element_key]) ? $item[$element_key] : NULL; } } Index: plugins/FeedsProcessor.inc =================================================================== --- plugins/FeedsProcessor.inc (revision 77) +++ plugins/FeedsProcessor.inc (working copy) @@ -355,19 +355,21 @@ if (empty($target_item)) { $target_item = array(); } - // Many mappers add to existing fields rather than replacing them. Hence we - // need to clear target elements of each item before mapping in case we are - // mapping on a prepopulated item such as an existing node. - foreach ($this->config['mappings'] as $mapping) { - if (isset($targets[$mapping['target']]['real_target'])) { - unset($target_item->{$targets[$mapping['target']]['real_target']}); - } - elseif (isset($target_item->{$mapping['target']})) { - unset($target_item->{$mapping['target']}); - } - } - /* This is where the actual mapping happens: For every mapping we envoke the parser's getSourceElement() method to retrieve the value of the source @@ -390,8 +392,18 @@ else { $value = $parser->getSourceElement($source, $result, $mapping['source']); } - // Map the source element's value to the target. - if (isset($targets[$this->id][$mapping['target']]) && - 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($source, $target_item, $mapping['target'], $value); + if (isset($value)) { // only if a column was present in the feed + // Many mappers add to existing fields rather than replacing them. Hence we + // need to clear target elements of each item before mapping in case we are + // mapping on a prepopulated item such as an existing node. + if (isset($targets[$mapping['target']]['real_target'])) { + unset($target_item->{$targets[$mapping['target']]['real_target']}); + } + elseif (isset($target_item->{$mapping['target']})) { + unset($target_item->{$mapping['target']}); + } + // Map the source element's value to the target. + if (isset($targets[$this->id][$mapping['target']]) && + 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($source, $target_item, $mapping['target'], $value); + } + else { + $this->setTargetElement($source, $target_item, $mapping['target'], $value); + } } - else { - $this->setTargetElement($source, $target_item, $mapping['target'], $value); - } if (isset($value)) { // only if a column was present in the feed // Map the source element's value to the target. if (isset($targets[$this->id][$mapping['target']]) && is_array($targets[$this->id][$mapping['target']]) &&