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

Advanced search: Excludng by multiple privacy settings works incorrectly

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.5
    • Fix Version/s: 4.5
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      When selecting multiple privacy options in advanced search, you have the choice of and "AND" or "OR" operator. However, when you choose to exclude rather than include the privacy options, "AND" and "OR" are reversed from the correct behavior. When you select "include" by privacy options, the behavior is correct.

      This is almost certainly because the SQL being produced is:
      !(A || B)

      the correct behavior would be
      !A || !B

      To reproduce on the demo server:
      Do an advanced search for all individuals. Get 193 contacts.
      Do a search to exclude "Do Not Phone". Get 157 contacts.
      Do a search to exclude "Do Not Trade". Get 160 contacts.
      Do a search to exclude "Do Not Phone" OR "Do Not Trade". Get 186 contacts.

        Attachments

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              palantejon Jon K Goldberg
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: