CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • API not filtering contacts on 'current_employer' after upgrade
Pages: [1]

Author Topic: API not filtering contacts on 'current_employer' after upgrade  (Read 643 times)

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
API not filtering contacts on 'current_employer' after upgrade
June 14, 2013, 10:10:42 am
I am updating to 4.3.4 from a site that was running 4.1.x and it looks like the API doesn't filter on 'current_employer' anymore. I've done some googling and tried poking around in api/v3/Contact.php but if anyone can give me a little bit of guidance it would help me get further along and try to make a fix.

As mentioned, the live site is running on 4.1.x and the API filter is working. The dev site is upgraded but this filter seems to be the final quirk before I can push it live.

I've verified that this happens on the demo site as well:
  • Create an org called "TEST"
  • Edit a contact and add "TEST" as current employer
  • Use the AJAX API explorer and filter with Contact>Get on 'current_employer=TEST'
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: API not filtering contacts on 'current_employer' after upgrade
June 14, 2013, 11:58:46 am
If we have any firm policies at all, one would be "if it doesn't have a unit test, it isn't officially supported"
So contributing a test for this that passes in 4.2 would be a good first step. Can you contribute that?
Try asking your question on the new CiviCRM help site.

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: API not filtering contacts on 'current_employer' after upgrade
June 14, 2013, 12:41:10 pm
I will do some googling and see if I can figure out how to make a unit test. I never got that far in my Civi training. :)
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: API not filtering contacts on 'current_employer' after upgrade
June 14, 2013, 05:33:36 pm
One workaround:

search on organization_name=TEST&contact_type=Individual and it works.

X+

P.S. And write a unit test about it, so it won't get broken. Or at least without someone noticing ;)

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: API not filtering contacts on 'current_employer' after upgrade
June 17, 2013, 08:47:25 pm
Thanks, Xavier! That is very helpful.

I will definitely keep trying on the unit test. I've started my self-instruction and don't doubt I'll get there soon...

L.
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • API not filtering contacts on 'current_employer' after upgrade

This forum was archived on 2017-11-26.