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) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Strange response using Contact API
Pages: [1]

Author Topic: Strange response using Contact API  (Read 1198 times)

ijames

  • Guest
Strange response using Contact API
March 01, 2010, 10:42:13 pm
Hi Folks, I saw that a similar bug had been fixed in 3.1.2, but I upgraded to 3.1.3 and unfortunately it didn't seem to help.

I'm calling civicrm_contact_add with params like this:

Array
(
    [email] => Fail7@shming.com
    [postal_code] => 90292
    [postal_code_suffix] => 6003
    [first_name] => Fail7
    [last_name] => Failered
    [custom_37] => Maybe
    [custom_34] => THIS IS MY ONE
    [custom_35] => THIS IS MY TWO
    [custom_12] => Dees Eeez My FOOOR
    [custom_19] => Yes
    [contact_id] => 2842
    [contact_type] => Individual
)

And I'm getting this error for the result:

Invalid Custom Field Contact Type: Individual

Also I got the same error when calling civicrm_location_get.

Strangely, things seem be working anyways. 

Suggestions?

Thanks a log!

James Saxon


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Strange response using Contact API
March 01, 2010, 11:57:43 pm
I'm assuming the custom fields are correct and set to work with Individuals ?

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

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Strange response using Contact API
March 02, 2010, 02:41:18 am
Xavier's suggestion would be my first check too.....make sure that the custom fields are all correct and can be used with an individual. Let us know how that looks :-)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

ijames

  • Guest
Re: Strange response using Contact API
March 02, 2010, 09:22:03 am
Thanks for the response. 

I had observed that some of these fields were originally type Individual but have now switched to type Contact.  The way I'm seeing this is that in the Custom Data Groupings, I'm seeing a group that shows Used For: "Individuals" for some of the data, and another group showing "All Contact Types".

So that sounds like it's causing a problem?

The strange thing is the fields appear to be correctly being set even though I'm receiving an error message.   

Do I split the civicrm_contact_add into two calls, one for Individual and one for Contact or...?

Thanks for the replies!

James


Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Strange response using Contact API
March 02, 2010, 11:24:54 pm
It is almost like once you start using array elements in parms for custom fields it treats everything after as custom fields.....have you checked that? A long shot and very unlikely but worth a try?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: Strange response using Contact API
April 28, 2010, 08:21:17 am
This is the issue as far as I can tell on 3.1.4 :
http://issues.civicrm.org/jira/browse/CRM-6163

Although if somebody as a different idea let me know!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Strange response using Contact API

This forum was archived on 2017-11-26.