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) »
  • relationship api get
Pages: [1]

Author Topic: relationship api get  (Read 770 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
relationship api get
March 27, 2011, 05:22:34 pm
Hi,

Just tried to use relationship api & I noticed that although 'contact_id_a' is required the value pass is treated as 'contact_id' & gets both

Changing this:
 
Quote
      civicrm_api3_verify_mandatory($params);
   
        if ( !isset( $params['contact_id_a'] ) ) {
            return civicrm_api3_create_error(  'Could not find contact_id_a in input parameters.'  );
        }


To

Code: [Select]
        civicrm_api3_verify_mandatory($params,null,array('contact_id'));
   
        require_once 'CRM/Contact/BAO/Relationship.php';
        $contactID     = $params['contact_id'];


Would more accurately reflect current behaviour (although I don't want to make this change at the moment because it would probably break the tests)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: relationship api get
March 27, 2011, 05:31:49 pm
OK - this api also doesn't take any other parameters from the looks of it? ie. I pass in relationship_type_id =1 to the get & it doesn't narrow it down at all.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: relationship api get
August 16, 2011, 06:16:00 pm
I'm having the same experience.  Did you find a work around?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • relationship api get

This forum was archived on 2017-11-26.