From e14ba583a82772ec752b6e64d299c6ab158a92f9 Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Wed, 9 Aug 2017 13:49:17 -0400 Subject: [PATCH] Allow creating relationship types with no contact type specified --- api/v3/RelationshipType.php | 2 -- tests/phpunit/api/v3/RelationshipTypeTest.php | 15 +-------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/api/v3/RelationshipType.php b/api/v3/RelationshipType.php index 30f238692a1e..4260edc42cac 100644 --- a/api/v3/RelationshipType.php +++ b/api/v3/RelationshipType.php @@ -77,8 +77,6 @@ function civicrm_api3_relationship_type_create($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_relationship_type_create_spec(&$params) { - $params['contact_type_a']['api.required'] = 1; - $params['contact_type_b']['api.required'] = 1; $params['name_a_b']['api.required'] = 1; $params['name_b_a']['api.required'] = 1; $params['is_active']['api.default'] = 1; diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index 24e44e109de5..1b6ad286e4cb 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -93,19 +93,6 @@ public function testRelationshipTypeCreateWithoutName() { ); } - /** - * Check with no contact type. - */ - public function testRelationshipTypeCreateWithoutContactType() { - $relTypeParams = array( - 'name_a_b' => 'Relation 1 without contact type', - 'name_b_a' => 'Relation 2 without contact type', - ); - $result = $this->callAPIFailure('relationship_type', 'create', $relTypeParams, - 'Mandatory key(s) missing from params array: contact_type_a, contact_type_b' - ); - } - /** * Create relationship type. */ @@ -190,7 +177,7 @@ public function testRelationshipTypeDelete() { public function testRelationshipTypeUpdateEmpty() { $params = array(); $result = $this->callAPIFailure('relationship_type', 'create', $params); - $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: name_a_b, name_b_a, contact_type_a, contact_type_b'); + $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: name_a_b, name_b_a'); } /**