? 753426-34_update_existing.patch
? 753426-43_update_existing.patch
? 836090-config-hashes.txt
? 836090.patch
? 837922-mapping-testing.patch
? 840626-7_support_multiple.patch
? feeds_better_testing.patch
? feeds_mapping_testing.patch
? tmp.patch
Index: feeds.api.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/feeds.api.php,v
retrieving revision 1.11
diff -u -p -r1.11 feeds.api.php
--- feeds.api.php	19 Jun 2010 15:32:07 -0000	1.11
+++ feeds.api.php	6 Jul 2010 15:23:10 -0000
@@ -129,6 +129,10 @@ function hook_feeds_user_processor_targe
  * Alter mapping targets for nodes. Use this hook to add additional target
  * options to the mapping form of Node processors.
  *
+ * real_target is an optional property that (if set) will empty the given
+ * property of the target item before mapping instead of empting the key
+ * specified in the $targets array. See mappers/link.inc
+ *
  * For an example implementation, see mappers/content.inc
  *
  * @param &$targets
@@ -144,6 +148,12 @@ function hook_feeds_node_processor_targe
     'description' => t('Description of what my custom node field does.'),
     'callback' => 'my_callback',
   );
+  $targets['my_node_field2'] = array(
+    'name' => t('My Second custom node field'),
+    'description' => t('Description of what my second custom node field does.'),
+    'callback' => 'my_callback2',
+    'real_target' => 'my_node_field_two',
+  );
 }
 
 /**
Index: mappers/date.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/mappers/date.inc,v
retrieving revision 1.2
diff -u -p -r1.2 date.inc
--- mappers/date.inc	29 Mar 2010 02:55:50 -0000	1.2
+++ mappers/date.inc	6 Jul 2010 15:23:10 -0000
@@ -23,11 +23,13 @@ function date_feeds_node_processor_targe
           'name' => $name .': Start',
           'callback' => 'date_feeds_set_target',
           'description' => t('The start date for the !name field. Also use if mapping both start and end.', array('!name' => $name)),
+          'real_target' => $field_name,
         );
         $targets[$field_name .':end'] = array(
           'name' => $name .': End',
           'callback' => 'date_feeds_set_target',
           'description' => t('The end date for the @name field.', array('@name' => $name)),
+          'real_target' => $field_name,
         );
       }
     }
Index: mappers/link.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/mappers/link.inc,v
retrieving revision 1.1
diff -u -p -r1.1 link.inc
--- mappers/link.inc	19 Jun 2010 16:53:34 -0000	1.1
+++ mappers/link.inc	6 Jul 2010 15:23:10 -0000
@@ -22,6 +22,7 @@ function link_feeds_node_processor_targe
           'name' => t('!field_name (URL)', array('!field_name' => $name)),
           'callback' => 'link_feeds_set_target',
           'description' => t('The URL for the CCK !name field of the node.', array('!name' => $name)),
+          'real_target' => $field_name,
         );
 
         //Provides a mapping target for the field title if used.
@@ -30,6 +31,7 @@ function link_feeds_node_processor_targe
             'name' => $name .' (' . t('title').')',
             'callback' => 'link_feeds_set_target',
             'description' => t('The title for the CCK !name field of the node.', array('!name' => $name)),
+            'real_target' => $field_name,
           );
         }
       }
Index: mappers/taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/mappers/taxonomy.inc,v
retrieving revision 1.1
diff -u -p -r1.1 taxonomy.inc
--- mappers/taxonomy.inc	5 Dec 2009 01:38:27 -0000	1.1
+++ mappers/taxonomy.inc	6 Jul 2010 15:23:10 -0000
@@ -19,6 +19,7 @@ function taxonomy_feeds_node_processor_t
       'name' => "Taxonomy: ". $vocab->name,
       'callback' => 'taxonomy_feeds_set_target',
       'description' => $description,
+      'real_target' => 'taxonomy',
     );
   }
 }
Index: plugins/FeedsProcessor.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsProcessor.inc,v
retrieving revision 1.11
diff -u -p -r1.11 FeedsProcessor.inc
--- plugins/FeedsProcessor.inc	19 Jun 2010 15:57:13 -0000	1.11
+++ plugins/FeedsProcessor.inc	6 Jul 2010 15:23:10 -0000
@@ -95,6 +95,28 @@ abstract class FeedsProcessor extends Fe
       $target_item = array();
     }
 
+    // Convert $target_item to object if it's an array so we will have less
+    // logic. We will convert it back after we do the mapping.
+    if (is_array($target_item)) {
+      $target_item = (object)$target_item;
+      $convert_to_array = TRUE;
+    }
+
+    // Clear the target elements of each item beforehand because we want to
+    // aggregate per map() call only.
+    foreach ($targets[$this->id] as $target_name => $target) {
+      if (isset($target['real_target']) && isset($target_item->$target['real_target'])) {
+        unset($target_item->$target['real_target']);
+      }
+      else if (isset($target_item->$target_name)) {
+        unset($target_item->$target_name);
+      }
+    }
+    
+    if ($convert_to_array) {
+      $target_item = (array)$target_item;
+    }
+
     /*
     This is where the actual mapping happens: For every mapping we envoke
     the parser's getSourceElement() method to retrieve the value of the source
