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

Author Topic: yuck yuck yuck - membership get  (Read 1203 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
yuck yuck yuck - membership get
May 13, 2011, 12:39:23 am
It turns out membership get returns values indexed by contact_id  then by membership_id - are we still early enough we can change this non-compliant behaviour? Or do we have to introduce some wierd deprecation ritual?
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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: yuck yuck yuck - membership get
May 13, 2011, 12:50:02 am
While no one is watching, I'd suggest to do the punk thing and no future the contact_id then membership_id

(and if can be sure membership_id is id, I'd go for it too )

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: yuck yuck yuck - membership get
May 13, 2011, 03:20:54 am
OK - the extra layer is gone - cross fingers no-one was relying on it yet....
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: yuck yuck yuck - membership get
May 13, 2011, 04:28:05 am
OK,

Have changed the membership_get output format in terms of array indexing & adding 'custom_1' (haven't removed 'custom_1_123'.

The API is still yuckity yuck yuck & I'd appreciate someone else looking at that function too.  There are some things set that don't seem to go anywhere.  - e/g clone($relationship) line 256; (I have focussed on tests / outputs)

Also, looking at what I did in terms of returning 'related_contact' on membership I'm pretty sure I did it wrong but not really sure what it would ideally be (although clearly not

array('contact_id' => 'relationship_id', = member_details) like it was
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: yuck yuck yuck - membership get
May 13, 2011, 04:32:55 am
NB - couldn't find any reference in core or drupal modules to  v3 membership api get
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: yuck yuck yuck - membership get
May 13, 2011, 08:34:04 pm
Not quite sure what we should do on this one in terms of returning related memberships (the original api did.), so, each membership I guess could have

master_id
related_ids - as an array?

Still v keen to get some more eyes on the function
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

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

This forum was archived on 2017-11-26.