From: Donald A. Lobo Date: Tue, 12 Mar 2013 20:36:06 +0000 (-0700) Subject: CRM-12100 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0944820d2298fe19235327d1cc48b12584bc5ea4;p=civicrm-core.git CRM-12100 --- 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']) {