Skip to content

Commit

Permalink
Fixed issue with province drenthe
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapjansma committed Feb 21, 2019
1 parent 099fb81 commit ceb716d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions CRM/Postcodenl/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ protected function updateAddressFields($id, &$params) {
}

protected function getProvinceIdByDutchName($province) {
$result = civicrm_api3('StateProvince', 'get', array(
$result = civicrm_api3('Address', 'getoptions', array(
'sequential' => 1,
'field' => "state_province_id",
'country_id' => 1152,
));
foreach($result['values'] as $state_province) {
if (ts($state_province['name']) == $province) {
return $state_province['id'];
if ($state_province['value'] == $province) {
return $state_province['key'];
}
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion postcodenl.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function postcodenl_civicrm_post( $op, $objectName, $objectId, &$objectRef ) {
function postcodenl_civicrm_searchTasks( $objectName, &$tasks ) {
if ($objectName == 'contact' && CRM_Core_Permission::check('administer CiviCRM')) {
$tasks['postcodenl_update_addresses'] = array(
'title' => ts('Update address from newest Postcode database'),
'title' => ts('Update addresses from Dutch postcode database'),
'class' => 'CRM_Postcodenl_Task_Update'
);
}
Expand Down

0 comments on commit ceb716d

Please sign in to comment.