Skip to content
Snippets Groups Projects

API for getaddress.io has considerably changed. Have updated the getaddressio...

Merged taylormadeapps requested to merge ttaylor/ukpostcodes:getaddress_api_changes into master

API for getaddress.io has considerably changed. Have updated the getaddressio driver to work with latest API. I withdrew the orginal PR as it needed tidying up a bit. Here's my second attempt.

Merge request reports

Approval is optional

Merged by mattwiremattwire 11 months ago (Mar 13, 2024 1:54pm UTC)

Merge details

  • Changes merged into master with 8bcefb35.
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • taylormadeapps mentioned in issue #8

    mentioned in issue #8

  • mattwire mentioned in commit 8bcefb35

    mentioned in commit 8bcefb35

  • merged

  • As configured, this is not now placing all the retrieved fields in the right place in CiviCRM; village names are in getaddressIO field {locality} (which logically comes before Town/City in postal addresses, so the $querystring in line 100 should be reordered), but as Civi only has 4 address fields (including "City") + Postcode, getaddressIO address_bits [2], [3] and [4] need to be concatenated into one Civi field - $address['supplemental_address_2'], as shown below (note the use of ".=")

    I'm not familiar with submitting commits, so please could someone deal with this.

    Cheers, Tom Crawshaw

    line 100

    querystring="apikey=querystring = "api-key=
    apiKey&all=true&template={line_1},{line_2},{line_3},{line_4},{locality},{town_or_city},{county}";

    lines 245 - 256 if (!empty($address_bits[0])) { $address['street_address'] = $address_bits[0]; }

    if (!empty($address_bits[1])) {
      $address['supplemental_address_1'] = $address_bits[1];
    }
    
    if (!empty($address_bits[2])) {
      $address['supplemental_address_2']=$address_bits[2];
    }
    
    if (!empty($address_bits[3])) {
      $address['supplemental_address_2'].=$address_bits[3];
    }
    
    if (!empty($address_bits[4])) {
      $address['supplemental_address_2'].=$address_bits[4];
    }
    
    if (!empty($address_bits[5])) {
      $address['city'] = $address_bits[5];
Please register or sign in to reply
Loading