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

Drupal Views of CiviCRM contacts including address fields show significant duplicate results

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.7.19, 4.7.22
    • Fix Version/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      Previously working views of contacts with multiple addresses no longer display correctly, with significant duplication of addresses resulting.

      Edit - I've found that this happens with views of CiviCRM contacts that include fields from the CiviCRM address entity - the affected view was like this with an attachment display showing the contact's addresses. Views of CiviCRM addresses (via a view of those entities, not contacts) work as expected. I've added steps to recreate at the end.

      It seems like the view displays every possible combination of different address elements from all the addresses. So if you have two address types, one has a postcode and the other doesn't, you will see four addresses, two versions of each type with and without the postcode. If the postcode and the street address are different between the two addresses, you'll see eight different addresses, and so on.

      See here for example with screenshots etc where another developer discovered the issue while trying to create a new view:

      https://civicrm.stackexchange.com/questions/18892/how-to-display-only-unique-civicrm-contact-address-in-drupal-view

      Haven't been able to confirm this still happens in current version (still running 4.19), will update - Edit - can confirm this is still happening with 4.22. 

      Steps to recreate:

      Create view of CiviCRM contacts (contacts should have multiple addresses for different location types) - add address entity fields to the view.

      Workaround: Use the contrib views_field_view module to add the addresses via adding a global:view field of a separately created view of CiviCRM addresses (this may have performance impacts unless views caching is used according to the documentation)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mjcarter Miles Carter
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: