Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.0.2
-
Fix Version/s: 3.0.4
-
Component/s: CiviCRM API
-
Labels:None
Description
The relationship API returns an error if I try to establish a relation between an individual and an organization when the setup is All contacttypes.
I have set up a relationship type called Partner (see attachment) with All Contacttypes.
When I use the following code to add a relationship I get an error (Contact ID :3315 is not of contact type).
Code:
$params = array(
'contact_id_a' => 3315,
'contact_id_b' => 3314,
'relationship_type_id' => 30,
'start_date' => date("Y-m-d", strtotime("2010-01-14")),
'is_active' => 1);
// Call CiviCRM API functie to add relation:
$rel = & civicrm_relationship_create( $params );
/* write error if civicrm returns error */
print_r($rel);
The error disappears if I change the setup of the relationship to From Person To Organization. But I need this type as well between Organizations, and I assume this should work.