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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.1 Release Testing »
  • API doesn't support contact subtypes or renamed contact types
Pages: [1]

Author Topic: API doesn't support contact subtypes or renamed contact types  (Read 2256 times)

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
API doesn't support contact subtypes or renamed contact types
December 18, 2009, 08:27:16 am
Hi,

Very impressed by how much good new stuff has been crammed into 3.1.beta2! The team has been busy, good work.

I've been trying out contact subtypes. Seems to work well in the UI, from a brief play, but isn't currently supported in the API:

"Invalid Contact Type: Care Provider"

Code: [Select]
mysql> select * from civicrm_contact_type;
+----+---------------------+---------------------+-------------+-----------+-----------+-----------+-------------+
| id | name                | label               | description | image_URL | parent_id | is_active | is_reserved |
+----+---------------------+---------------------+-------------+-----------+-----------+-----------+-------------+
|  1 | Individual          | Individual          | NULL        | NULL      |      NULL |         1 |           1 |
|  2 | Household           | Household           | NULL        | NULL      |      NULL |         1 |           1 |
|  3 | Organization        | Organization        | NULL        | NULL      |      NULL |         1 |           1 |
|  4 | Care_Provider       | Care Provider       | NULL        | NULL      |         3 |         1 |        NULL |
|  5 | Parent_Organisation | Parent Organisation | NULL        | NULL      |         3 |         1 |        NULL |
+----+---------------------+---------------------+-------------+-----------+-----------+-----------+-------------+

I also tried passing 'Care_Provider'.

I think the culprits are api/v2/Contact.php civicrm_contact_check_params() and api/v2/utils.php _civicrm_required_formatted_contact(), which both hard-code the contact types.

Dave J

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: API doesn't support contact subtypes or renamed contact types
December 18, 2009, 09:49:08 am
I think contact type should be "Organization" and subtype "Care Provider" or "Care_Provider" ?

Kurund
Found this reply helpful? Support CiviCRM

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: API doesn't support contact subtypes or renamed contact types
December 18, 2009, 11:02:35 am
Hi Kurund,

Quote from: Kurund Jalmi on December 18, 2009, 09:49:08 am
I think contact type should be "Organization" and subtype "Care Provider" or "Care_Provider" ?

Ah, I see. Right, I found the winning combination:

Code: [Select]
  $orgParams = array(
    'contact_type'  => 'Organization',
    'contact_sub_type'  => 'Care_Provider',
    'organization_name' => $orgname,
  );

Many thanks, great work on 3.1. Have a wonderful holiday.

Dave J

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.1 Release Testing »
  • API doesn't support contact subtypes or renamed contact types

This forum was archived on 2017-11-26.