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

Address-related filter and sort criteria in Views lack support for "use primary address" setting

    Details

    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      Because these criteria don't allow you to specify "use only primary address", the civicrm_address table is joined without specifying "is_primary=1" (as is correctly done for fields when this setting is selected). This leads to non-primary addresses being included in the list, which yields two undesirable side-effects for contacts with multiple addresses:

      1. If the first address is in a different state, the state in the other address may be sorted in the wrong order. For example a contact which has a primary address in NM and a secondary address in AZ can be lead to the sorting of New Mexico directly after Arizona.
      2. The contact will be listed multiple times, once for each address.

      I have a client for whom I'm seeking to fix this now, and will be happy to provide a PR if I can.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              allenshaw Allen Shaw
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: