From a15c0aa218fabd2de93e962dc7c697c4bf7ce72f Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Thu, 31 May 2012 09:26:48 -0400
Subject: [PATCH] Add some padding to iframe footer

---
 program/steps/addressbook/func.inc |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index eb8a0e5..bd38194 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -593,7 +593,12 @@
                         $composite = array(); $j = 0;
                         $template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}');
                         foreach ($colprop['childs'] as $childcol => $cp) {
-                            $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j];
+                            if (!empty($val) && is_array($val)) {
+                                $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j];
+                            }
+                            else {
+                                $childvalue = '';
+                            }
 
                             if ($edit_mode) {
                                 if ($colprop['subtypes'] || $colprop['limit'] != 1) $cp['array'] = true;
@@ -669,7 +674,7 @@
                 }
             }
 
-            if (!$content)
+            if (!$content && (!$edit_mode || !$select_add->_count))
                 continue;
 
             // also render add-field selector

--
Gitblit v1.9.1