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

Don't check custom fields when avoiding duplicsate relationships

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.12
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Versioning Impact:
      None (no code merged)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      When creating a relationship civi calls CRM_Contact_BAO_Relationship->checkDuplicateRelationship() and detects if one exists of the same type and between the same entities. It does some checks on the start and end date. Fair enough. But then civi calls checkDuplicateCustomFields() and checks for equality in custom field values and I do not understand why.

      Example: We provide extra fields »position« and »department« on employee relationship records. Sometimes we're updating contacts by scripts or via api and if two contacts don't share an employee relationship, we want to add one. But those operations always lead to duplicated relationships if the contacts have edited custom fields.

      Could anybody tell me why it's important to operate like civi does? Wouldn't it be better to return "Relationshiop already exists" and let the user decide what to do with custom fields?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nielo Niels Heinemann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: