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 (Moderator: Donald Lobo) »
  • Location API (two issues)
Pages: [1]

Author Topic: Location API (two issues)  (Read 1397 times)

obsidiandesign

  • Guest
Location API (two issues)
March 22, 2008, 11:46:28 am
Hi,

I'm trying to use the v2 Location & Events API's through a Drupal module.  I can create an event successfully, but I'm having trouble emulating the behavior of CiviEvent through the Location API.

When a new event is created, the location information is stored in the civicrm tables, with a lookup created in the loc_block table.  In each (address, email, phone) table, the contact_id is NULL.  However, through the API, I cannot create a location with a contact_id of NULL.  Is it possible to do the same thing?  Should I extend the API to do the same thing?

Second question - related to the first really, can a loc_block be created through the API?  civicrm_location_add does not do it.  I had hoped it would, because I don't see an API for it.

Thanks in advance.

Bryan
Obsidian Design

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: Location API (two issues)
March 22, 2008, 12:15:53 pm

1. you will need to extend the location api to deal with a null contact id

2. u'll need to access the CiviCRM functions to create a location block. You might want to check the event code and see what functions we call to do the needful

We hope to figure out a good API strategy for 2.x

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Location API (two issues)

This forum was archived on 2017-11-26.