Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-4262

Error with relationshiptype configuration not reported in API Relationship

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.1
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      I have configured a relationshiptype between Person and Person. That was incorrect as I wanted to create one from Person to Household, but I did not notice my mistake at first. I then used an import script to load demo data into CiviCRM 2.2. To load relations I use the relationship API:

      // Parameter array voor CiviCRM API om relatie toe te voegen:
      $params = array(
      'contact_id_a' => $civicrm_id,
      'contact_id_b' => $relatie_id_b,
      'relationship_type_id' => $relationship_type_id,
      'start_date' => $vandaag,
      'is_active' => 1
      );

      // Aanroepen CiviCRM API functie om relatie toe te voegen:

      $relatie = & civicrm_relationship_create( $params );
      if( civicrm_error( $relatie))

      { $fouten[$i] = "Fout bij relatie leggen van contact : ".$civicrm_id." naar contact : " .$relatie_id_b." : ". $relatie['error_message']; $i++; }

      The data I loaded tried to set up a relationship between a Person and a Household. The API did not add this relationship, which was correct as I configured it to be from Person to Person. However, I did not receive an error from the API. I simply did not do the create relationship and moved on without message. I did find my mistake in the configuration later, but I think there should have been an error message, telling me it there was a conflict with the configuration of the relationship type.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              erikhommel Erik Hommel
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: