From 89fe412f2c5127e1015887d280a09c645af6d172 Mon Sep 17 00:00:00 2001
From: Alex Barth <alex_b@53995.no-reply.drupal.org>
Date: Mon, 2 Nov 2009 20:32:00 +0000
Subject: [PATCH] Now all getMappingSources() return values are homogenous.
 Remove complexity from form code.

---
 feeds_ui/feeds_ui.admin.inc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/feeds_ui/feeds_ui.admin.inc b/feeds_ui/feeds_ui.admin.inc
index a17c11e4..18043ffe 100644
--- a/feeds_ui/feeds_ui.admin.inc
+++ b/feeds_ui/feeds_ui.admin.inc
@@ -500,9 +500,8 @@ function feeds_ui_mapping_form(&$form_state, $importer) {
   if ($sources = $importer->parser->getMappingSources()) {
     $source_options = _feeds_ui_format_options($sources);
     foreach ($sources as $k => $source) {
-      // @todo: make format homogenous.
-      $legend['sources'][$k]['name']['#value'] = is_array($source) ? $source['name'] : $source;
-      $legend['sources'][$k]['description']['#value'] = (is_array($source) && !empty($source['description'])) ? $source['description'] : '';
+      $legend['sources'][$k]['name']['#value'] = empty($source['name']) ? $k : $source['name'];
+      $legend['sources'][$k]['description']['#value'] = empty($source['description']) ? '' : $source['description'];
     }
   }
   else {
-- 
GitLab