diff --git a/feeds_ui/feeds_ui.admin.inc b/feeds_ui/feeds_ui.admin.inc index a6a827775ae8989870fec2b4e895692d834a8513..d21a78049f92698d5ab603496db316217609ee93 100644 --- a/feeds_ui/feeds_ui.admin.inc +++ b/feeds_ui/feeds_ui.admin.inc @@ -492,6 +492,7 @@ function feeds_ui_mapping_form(&$form_state, $importer) { $form = array(); $form['#importer'] = $importer; + $form['#mappings'] = $mappings = $importer->processor->getMappings(); $form['help']['#value'] = feeds_ui_mapping_help(); // Get mapping sources from parsers and targets from processor, format them @@ -514,6 +515,7 @@ function feeds_ui_mapping_form(&$form_state, $importer) { $legend['targets'][$k]['description']['#value'] = empty($target['description']) ? '' : $target['description']; } + // Legend explaining source and target elements. $form['legendset'] = array( '#type' => 'fieldset', '#title' => t('Legend'), @@ -524,20 +526,16 @@ function feeds_ui_mapping_form(&$form_state, $importer) { $form['legendset']['legend'] = $legend; // Add unique and remove forms to mappings. - $mappings = $importer->processor->getMappings(); $form['unique_flags'] = $form['remove_flags'] = array( '#tree' => TRUE, ); - if (is_array($mappings)) { foreach ($mappings as $i => $mapping) { $param = array( 'processor' => $importer->processor, 'mapping' => $mapping, ); - if (isset($targets[$mapping['target']]['optional_unique']) && $targets[$mapping['target']]['optional_unique'] === TRUE) { - $form['unique_flags'][$i] = array( '#type' => 'checkbox', '#default_value' => !empty($mapping['unique']), @@ -553,9 +551,7 @@ function feeds_ui_mapping_form(&$form_state, $importer) { } } - $form['#mappings'] = $mappings; - $form['#targets'] = $targets; - if ($sources) { + if ($source_options) { $form['source'] = array( '#type' => 'select', '#options' => array('' => t('Select a source')) + $source_options,