From 91cd96636b4a4d673c49a1fea3727da6b9636441 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 25 Mar 2021 10:41:17 +1300 Subject: [PATCH] Additional fix for membership It turns out the formatting the membership parser was doing was being overwritten & the overwritten version was better - so, just don't format in the membership parser --- CRM/Member/Import/Parser/Membership.php | 2 -- .../phpunit/CRM/Member/Import/Parser/MembershipTest.php | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 237e4c3d3a..0a649a2b23 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -664,8 +664,6 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { } } - _civicrm_api3_custom_format_params($params, $values, 'Membership'); - if ($create) { // CRM_Member_BAO_Membership::create() handles membership_start_date, membership_join_date, // membership_end_date and membership_source. So, if $values contains diff --git a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php index 59de09c1ce..3a8562e7ae 100644 --- a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php @@ -53,7 +53,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ @@ -96,7 +96,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_membership', 'civicrm_membership_log', @@ -114,6 +114,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * Test Import. * * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public function testImport() { $this->individualCreate(); @@ -334,9 +335,9 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * Test importing to a custom field. * * @throws \API_Exception - * @throws \CRM_Core_Exception + * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception */ - public function testImportCustomData() { + public function testImportCustomData(): void { $donaldDuckID = $this->individualCreate(['first_name' => 'Donald', 'last_name' => 'Duck']); $this->createCustomGroupWithFieldsOfAllTypes(['extends' => 'Membership']); $membershipImporter = $this->createImportObject([ -- 2.25.1