Additional fix for membership
authoreileen <emcnaughton@wikimedia.org>
Wed, 24 Mar 2021 21:41:17 +0000 (10:41 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 24 Mar 2021 21:41:17 +0000 (10:41 +1300)
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
tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php

index 237e4c3d3a859780739d5d06d1e0471b3cbe74a1..0a649a2b236cd4da5443f6dc658d509d6582e9d8 100644 (file)
@@ -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
index 59de09c1ce9f2f2847ed6f25939f4cc4d51d0536..3a8562e7ae6dc78db7c4f9d81a3beece37d66631 100644 (file)
@@ -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([