Index: feedapi_mapper.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feedapi_mapper/feedapi_mapper.install,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 feedapi_mapper.install
--- feedapi_mapper.install	7 Aug 2009 14:07:44 -0000	1.2.2.2
+++ feedapi_mapper.install	12 Aug 2009 11:37:19 -0000
@@ -6,7 +6,7 @@
  */
 function feedapi_mapper_schema() {
   $schema['feedapi_mapper'] = array(
-    'description' => 'Stores data for the feedapi mapper',
+    'description' => 'Stores the mappings for the feedapi mapper',
     'export' => array(
       'key' => 'param',
       'identifier' => 'feedapi_mapper',
@@ -19,8 +19,18 @@ function feedapi_mapper_schema() {
       ),
     ),
     'fields' => array(
+      'mid' => array(
+        'description' => 'The primary identifier for a mapping.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE),
+      'name' => array(
+        'description' => 'Human-readable identifier for a mapping',
+        'type' => 'varchar',
+        'length' => 256,
+	'not null' => TRUE),
       'param' => array(
-        'description' => 'The identifier of the mapping. Can be a nid or a content-type name.',
+        'description' => 'Where the mapping belongs to. Can be a nid or a content-type name.',
         'type' => 'varchar',
         'length' => 32,
         'not null' => TRUE),
@@ -36,6 +46,21 @@ function feedapi_mapper_schema() {
         'not null' => TRUE,
         'serialize' => TRUE),
       ),
+    'primary key' => array('mid'),
+  );
+  $schema['feedapi_mapper_active'] = array(
+    'description' => 'Stores data to determine the active mapping for the feedapi mapper.',
+    'fields' => array(
+      'param' => array(
+        'description' => 'Where the mapping belongs to. Can be a nid or a content-type name.',
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE),
+      'active' => array(
+        'description' => 'mid from {feedapi_mapper} or -1 to use the exported code',
+        'type' => 'int',
+        'not null' => TRUE),
+    ),
     'primary key' => array('param'),
   );
   return $schema;
Index: feedapi_mapper.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feedapi_mapper/feedapi_mapper.module,v
retrieving revision 1.2.2.17
diff -u -p -r1.2.2.17 feedapi_mapper.module
--- feedapi_mapper.module	7 Aug 2009 15:43:43 -0000	1.2.2.17
+++ feedapi_mapper.module	12 Aug 2009 11:37:20 -0000
@@ -367,8 +367,18 @@ function feedapi_mapper_load_mapping($fe
  * or per node type mapping automatically depending on availability.
  */
 function _feedapi_mapper_load_mapping($param) {
+  $active = db_result(db_query("SELECT active FROM {feedapi_mapper_active} WHERE param = '%s'", $param));
   ctools_include('export');
-  if ($mapping = ctools_export_load_object('feedapi_mapper', 'conditions', array('param' => $param))) {
+  if ($active !== FALSE && $active > 0) {
+    $mapping = ctools_export_load_object('feedapi_mapper', 'conditions', array('mid' => $active));
+  }
+  elseif ($active !== FALSE) {
+    $mapping = ctools_get_default_object('feedapi_mapper', $param);
+  }
+  else {
+    $mapping = ctools_export_load_object('feedapi_mapper', 'conditions', array('param' => $param));
+  }
+  if ($mapping) {
     $mapping = (array) array_pop($mapping);
     if (!empty($mapping['mapping'])) {
       return $mapping;
