From 31ad005a0b0af81bd867287e686bce1d15854220 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 15 Jul 2014 16:26:44 +0000 Subject: [PATCH] Add owner as exception to contact_ prefixing, it's used as a flag in searching. Fixes ambiguous column error when filtering by owner and custom field. --- .../inc/class.addressbook_export_contacts_csv.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php index 275aa4a5be..e675ad43b2 100644 --- a/addressbook/inc/class.addressbook_export_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_export_contacts_csv.inc.php @@ -100,8 +100,8 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi } continue; } - // Custom fields & listed are not filtered with contact_ prefix - if(strpos($field, '#') !== 0 && !in_array($field, array('tid'))) + // Custom fields & listed exceptions are not filtered with contact_ prefix + if(strpos($field, '#') !== 0 && !in_array($field, array('tid','owner'))) { $field = 'contact_'.$field; } @@ -119,6 +119,10 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi { $selection = explode(',',$options['selection']); } + if(!is_array($selection)) + { + $selection = array(); + } $GLOBALS['egw_info']['flags']['currentapp'] = $old_app; if(bo_merge::hasExportLimit($export_limit) && !$limit_exception) {