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 »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CIVI API Usage In Joomla
Pages: [1]

Author Topic: CIVI API Usage In Joomla  (Read 1381 times)

johng

  • Guest
CIVI API Usage In Joomla
December 28, 2009, 03:49:04 pm
Can anyone point me to some example(s) of using the API functions in the context of Joomla. All of the examples are for Drupal which doesn't particularly help me. Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CIVI API Usage In Joomla
December 28, 2009, 05:30:57 pm

can u be more specific? I dont think it should make too much of a difference whether its drupal or joomla. you can get on IRC and we can chat further there

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

johng

  • Guest
Re: CIVI API Usage In Joomla
December 29, 2009, 06:11:57 am
I was actually able to figure out how to do what I wanted to do. I do have a question about the custom options/fields API... when importing a custom option that is multi-select with custom fields, is there a way to import them so that they are "active?" As far as I could see the only options available were value, label, and weight.

johng

  • Guest
Re: CIVI API Usage In Joomla
December 29, 2009, 06:15:56 am
Nevermind, I was able to figure out how to do that by digging through the code. This post can be closed.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CIVI API Usage In Joomla
December 29, 2009, 06:46:13 am

hey john:

can u elaborate a bit more on what was the problem and how you resolved it. will help us improve the docs/code and potentially help other folks who run into the same issue

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

johng

  • Guest
Re: CIVI API Usage In Joomla
December 29, 2009, 07:16:11 am
Basically I was looking for a way to import a custom option that was multiselect and had 100s of options. As I didn't really want to enter each one by hand (the admin interface is pretty clunky for large amounts of data,) I was looking to do this via code or SQL. SQL didn't seem like a great idea as the schema is a bit complex and I don't know it well enough to know 100% I was putting data into all tables that needed it. I then stumbled upon the API for custom options in the wiki. The documentation was ok but lacking, and most of the examples were done in a drupal context. Links to SVN for other testing exampled did not work so I decided to experiment a bit and eventually got the API to work in a Joomla environment.

After I did an import (simple script that took info from a spreadsheet,) I noticed that all of the select options were marked as inactive. The documentation doesn't indicate how to pass in an array of active values so I dug through the API code a bit and discovered the option was there, just not documented. Using the option I found in the code I was able to pass in an array for the is_active column and all worked as I had hoped.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CIVI API Usage In Joomla

This forum was archived on 2017-11-26.