From bf50886798f4aac3c688c3d7ac05fcee844ba1ff Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 12 May 2014 22:31:15 +0000 Subject: [PATCH] Fix missing field mapping if editing an existing definition --- ...ss.importexport_wizard_basic_import_csv.inc.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/importexport/inc/class.importexport_wizard_basic_import_csv.inc.php b/importexport/inc/class.importexport_wizard_basic_import_csv.inc.php index 873bc68d7a..0db6d25bfd 100644 --- a/importexport/inc/class.importexport_wizard_basic_import_csv.inc.php +++ b/importexport/inc/class.importexport_wizard_basic_import_csv.inc.php @@ -282,10 +282,6 @@ class importexport_wizard_basic_import_csv } } } - foreach($content['csv_fields'] as $index => $title) - { - error_log("$index: $title => {$content['field_mapping'][$index]}"); - } unset($content['mapping']); switch (array_search('pressed', $content['button'])) { @@ -306,12 +302,20 @@ class importexport_wizard_basic_import_csv $content['step'] = 'wizard_step50'; $content['mapping'] = array(false); + if(array_key_exists('field_mapping', $content)) + { + $field = $content['field_mapping']; + } + else + { + $field = $content['plugin_options']['field_mapping']; + } foreach($content['csv_fields'] as $index => $title) { $content['mapping'][] = array( 'index' => $index, 'title' => $title, - 'field' => $content['field_mapping'][$index], + 'field' => $field[$index], 'conversion' => $content['field_conversion'][$index] ); }