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) »
  • street_address field
Pages: [1]

Author Topic: street_address field  (Read 689 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
street_address field
May 12, 2011, 04:30:04 pm
Street_address is the concatenation of  street_number, street_name (+ whatever else)

At the moment if you pass street_number, street_name, into address create api the street_address field is not populated. I'm assuming it should be possible to feed the api part of an address & have it fill in the street_address field - in which case should that be handling in the api itself - or the BAO...

NB if you pass in street_address & set street_parsing =1 it will be broken down into it's component parts
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: street_address field
May 12, 2011, 04:40:23 pm
NB - here's my - not-very-clever bit of code I stuck in my module

Code: [Select]
if (empty($params['street_address'])) {
   $addressComponents = array();
   if(!empty($params['street_number'])){
    $addressComponents[] = $params['street_number']  ;
   }
if(!empty($params['street_number_suffix'])){
    $addressComponents[] = $params['street_number_suffix']  ;
   }
if(!empty($params['street_unit'])){
    $addressComponents[] = $params['street_unit']  ;
   }
if(!empty($params['street_name'])){
    $addressComponents[] = $params['street_name']  ;
   }
          $params['street_address'] = implode(" ",  $addressComponents);
}
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) »
  • street_address field

This forum was archived on 2017-11-26.