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) »
  • Membership Create API call with custom fields (Multi-Select) delimiter issue
Pages: [1]

Author Topic: Membership Create API call with custom fields (Multi-Select) delimiter issue  (Read 590 times)

Wouter H.

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: D7
  • MySQL version: 5
  • PHP version: 5.4
Membership Create API call with custom fields (Multi-Select) delimiter issue
July 13, 2015, 02:52:22 am
Hi,

I noticed when saving custom fields (Multi-Select) with an Membership Create API call:

  • when trying to saved 1 value, the value is saved without delimiters
  • multiple values are saved as "[delimiter]Array[delimiter]"

Because of this issue, you can't use the CiviCRM search function to search Membership with these values set.

Kind Regards.
« Last Edit: July 13, 2015, 02:54:03 am by Wouter H. »

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Membership Create API call with custom fields (Multi-Select) delimiter issue
August 10, 2015, 07:53:18 am
Are you sure that single values are saved without a delimiter?

When a field can have multiple values. CiviCRM Usually saves this by [delimiter]value[delimeter]value[delimiter]

I don't know why this is the case but it is. And the class CRM_Core_DAO has a constant containing the delmiter. And I do think there is some functionality in the class to extract data from a multiple field. Not sure wether it is in the CRM_Core_DAO class or in another class such as CRM_Utils_Array
Developer at Edeveloper / CiviCoop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Membership Create API call with custom fields (Multi-Select) delimiter issue

This forum was archived on 2017-11-26.