Skip to content

Commit

Permalink
Merge pull request #65 from laryn/1.x-5.x-issue64
Browse files Browse the repository at this point in the history
Merge in 7.x-5.8
  • Loading branch information
herbdool authored Aug 9, 2023
2 parents 917485a + 49afb17 commit 79e0bdb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions includes/utils.inc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,17 @@ function wf_crm_get_fields($var = 'fields') {
'activity' => ['entity_type' => 'activity', 'label' => t('Activity'), 'max_instances' => 99, 'attachments' => TRUE],
'relationship' => ['entity_type' => 'contact', 'label' => t('Relationship'), 'help_text' => TRUE, 'custom_fields' => 'combined'],
];
$civicrm_version = wf_crm_apivalues('System', 'get')[0]['version'];
// Grant is moved to extension after > 5.47.0.
if (version_compare($civicrm_version, '5.47') >= 0) {
$components = array_diff($components, ['CiviGrant']);
$grantStatus = wf_crm_apivalues('Extension', 'get', [
'full_name' => 'civigrant'
], 'status');
if (array_pop($grantStatus) == 'installed') {
$components[] = 'CiviGrant';
}
}
$conditional_sets = [
'CiviCase' => ['entity_type' => 'case', 'label' => t('Case'), 'max_instances' => 30],
'CiviEvent' => ['entity_type' => 'participant', 'label' => t('Participant'), 'max_instances' => 9],
Expand Down
8 changes: 4 additions & 4 deletions includes/wf_crm_webform_postprocess.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1768,11 +1768,11 @@ class wf_crm_webform_postprocess extends wf_crm_webform_base {
$cid = $this->findDuplicateContact($contact);
}
$address = [
'street_address' => $this->billing_params['street_address'],
'city' => $this->billing_params['city'],
'country_id' => $this->billing_params['country_id'],
'street_address' => $this->billing_params['street_address'] ?? '',
'city' => $this->billing_params['city'] ?? '',
'country_id' => $this->billing_params['country_id'] ?? '',
'state_province_id' => wf_crm_aval($this->billing_params, 'state_province_id'),
'postal_code' => $this->billing_params['postal_code'],
'postal_code' => $this->billing_params['postal_code'] ?? '',
'location_type_id' => 'Billing',
];
$email = [
Expand Down

0 comments on commit 79e0bdb

Please sign in to comment.