From 0944820d2298fe19235327d1cc48b12584bc5ea4 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Tue, 12 Mar 2013 13:36:06 -0700 Subject: [PATCH] CRM-12100 --- CRM/Export/BAO/Export.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index f65b98291c..722a6f1b8e 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -1173,9 +1173,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c } static function sqlColumnDefn(&$query, &$sqlColumns, $field) { - if (substr($field, -4) == '_a_b' || - substr($field, -4) == '_b_a' - ) { + if (substr($field, -4) == '_a_b' || substr($field, -4) == '_b_a') { return; } @@ -1184,6 +1182,13 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c $fieldName = 'civicrm_primary_id'; } + // early exit for master_id, CRM-12100 + // in the DB it is an ID, but in the export, we retrive the display_name of the master record + if ($fieldName == 'master_id') { + $sqlColumns[$fieldName] = "$fieldName varchar(128)"; + return; + } + // set the sql columns if (isset($query->_fields[$field]['type'])) { switch ($query->_fields[$field]['type']) { -- 2.25.1