From ae9544a17f1443cafcd8ed37b6dcfebec85218e3 Mon Sep 17 00:00:00 2001
From: tmsimont <tmsimont@566678.no-reply.drupal.org>
Date: Tue, 14 May 2013 17:06:37 -0700
Subject: [PATCH] Issue #777888 by WorldFallz, liquidcms, firfin, tmsimont |
 timwood: Followup to importing importers.

---
 feeds_ui/feeds_ui.admin.inc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/feeds_ui/feeds_ui.admin.inc b/feeds_ui/feeds_ui.admin.inc
index 5bfc231e..96399b47 100644
--- a/feeds_ui/feeds_ui.admin.inc
+++ b/feeds_ui/feeds_ui.admin.inc
@@ -1175,12 +1175,14 @@ function feeds_ui_importer_import_validate($form, &$form_state) {
  */
 function feeds_ui_importer_import_submit($form, &$form_state) {
   $importer = $form_state['importer'];
-  $importer = feeds_importer($importer->id);
-  $importer->setConfig($importer->config);
+
+  // Create a copy of the importer to preserve config.
+  $save = feeds_importer($importer->id);
+  $save->setConfig($importer->config);
   foreach (array('fetcher', 'parser', 'processor') as $type) {
-    $importer->$type->setConfig($importer->config[$type]['config']);
+    $save->$type->setConfig($importer->config[$type]['config']);
   }
-  $importer->save();
+  $save->save();
 
   drupal_set_message(t('Successfully imported the %id feeds importer.', array('%id' => $importer->id)));
   $form_state['redirect'] = 'admin/structure/feeds';
-- 
GitLab