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

Advanced filtering on email or email_id does not work for the Contact API

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7
    • Fix Version/s: 4.7.9
    • Component/s: CiviCRM API
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      If I send this to the API:

          $result = civicrm_api3('Contact', 'get', array(
            'sequential' => 1,
            'email' => array('IS NOT NULL' => 1),
          ));
      

      I would expect getting the contacts without a primary e-mail address, but I just get all contacts. I tried this as well:

          $result = civicrm_api3('Contact', 'get', array(
            'sequential' => 1,
            'email' => array('<>' => ""),
          ));
      

      and even

          $result = civicrm_api3('Contact', 'get', array(
            'sequential' => 1,
            'email_id' => array('>' => "0"),
          ));
      

      The result is the same.

        Attachments

          Activity

            People

            • Assignee:
              jitendra.purohit Jitendra Purohit
              Reporter:
              johanv Johan Vervloet
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h