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

rest api : query contact -> requested clause 'NOT IN' becomes 'IN'

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.4.6, 4.5.2
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None

      Description

      With REST API (json) if i use a request with 'NOT IN' clause, I get a result as if i had used 'IN'

      My POST Param in json format:
      json={\"contact_id\":{\"NOT IN\":[1296,1297]}}

      Result : I get 2 contacts with ids 1296 and 1297.

      ---- in the source code civicrm 4.5.2:
      CRM_Contact_BAO_query.php line 1827
      The 'IN' clause is written in hard :
      $this->_where[0][] = "contact_a.id IN ({$idList})";

      so 'NOT IN' isn't supported for the array style syntax.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              valfr35 Valéry Gouleau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified