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

Custom relationships for custom contact types not available during export

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.9, 4.7
    • Fix Version/s: 4.7.14
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      This was found in version 4.6.9 and reproduced on the demo site.

      To reproduce:
      1) Create 2 Individual subtypes (patient and social worker)
      2) Create custom relationship Social Worker for/Social Worker is with social worker as contact type a and patient as contact type b
      3) Create Social Worker contact and Patient Contact
      4) Create the Social Worker for/Social Worker is relationship between the contacts created in #3.
      5) Advanced Search for Social Worker is relationship, select for export
      6) Select fields for export
      7) Select Social Worker as Record Type.

      Only built-in relationships are available in the selector.

      I fixed this for our client by changing CRM/Core/BAO/Mapping.php but I am not sure this is the best solution. I am also working with 4.6.x. In the buildMappingForm function (line 330 in version 4.6.9) I changed:
      $relationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $value); to
      $relationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $value, TRUE); which sets $all = TRUE in the function getContactRelationshipType.

      This results in ALL relationships being added.

      I can submit this change for 4.7.x if it is the best solution, but I doubt that it is. The client was able to get the data they needed, though.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ehendricks Ellen Hendricks
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: