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

          [CRM-19471] Custom relationships for custom contact types not available during export
          Monish Deb added a comment -

          Ellen Hendricks can you submit a PR for it ?

          John Kirk added a comment -

          Eileen McNaughton Reviewed and approved. Ellen Hendricks - this works because the relationship type is a directional one, and all makes it requests relationships from a to b and b to a.

            People

            • Assignee:
              Unassigned
              Reporter:
              Ellen Hendricks

              Dates

              • Created:
                Updated:
                Resolved: