From 4d8bdcecbb9e0204285e4d0250d3daefd729f900 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 25 Jul 2020 10:54:20 +1200 Subject: [PATCH] [REF] Remove unnecessary complexity on im export This just removes a couple of lines that were already marked as being likely unhelpful. Because the impact of these lines is tested the test needs tweaking too - but it only affects the name of the fields in the temp table and in internal php keys --- CRM/Export/BAO/ExportProcessor.php | 12 ------------ tests/phpunit/CRM/Export/BAO/ExportTest.php | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index a450729046..1338adaea1 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -1560,12 +1560,6 @@ class CRM_Export_BAO_ExportProcessor { * @return string */ protected function getOutputSpecificationIndex($key, $relationshipType, $locationType, $entityLabel) { - if ($entityLabel || $key === 'im') { - // Just cos that's the history... - if ($key !== 'master_id') { - $key = $this->getHeaderForRow($key); - } - } if (!$relationshipType || $key !== 'id') { $key = $this->getMungedFieldName($key); } @@ -1613,12 +1607,6 @@ class CRM_Export_BAO_ExportProcessor { * @return string */ protected function getOutputSpecificationFieldKey($key, $relationshipType, $locationType, $entityLabel) { - if ($entityLabel || $key === 'im') { - if ($key !== 'state_province' && $key !== 'id') { - // @todo - test removing this - indexing by $key should be fine... - $key = $this->getHeaderForRow($key); - } - } if (!$relationshipType || $key !== 'id') { $key = $this->getMungedFieldName($key); } diff --git a/tests/phpunit/CRM/Export/BAO/ExportTest.php b/tests/phpunit/CRM/Export/BAO/ExportTest.php index 5bc0f2d342..6420babe85 100644 --- a/tests/phpunit/CRM/Export/BAO/ExportTest.php +++ b/tests/phpunit/CRM/Export/BAO/ExportTest.php @@ -2576,7 +2576,7 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase { 'signature_text' => '`signature_text` longtext', 'signature_html' => '`signature_html` longtext', 'im_provider' => '`im_provider` text', - 'im_screen_name' => '`im_screen_name` varchar(64)', + 'im' => '`im` varchar(64)', 'openid' => '`openid` varchar(255)', 'world_region' => '`world_region` varchar(128)', 'url' => '`url` varchar(128)', @@ -2761,7 +2761,7 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase { 'signature_text' => '`signature_text` longtext', 'signature_html' => '`signature_html` longtext', 'im_provider' => '`im_provider` text', - 'im_screen_name' => '`im_screen_name` varchar(64)', + 'im' => '`im` varchar(64)', 'openid' => '`openid` varchar(255)', 'world_region' => '`world_region` varchar(128)', 'url' => '`url` varchar(128)', -- 2.25.1