diff --git a/includes/contact_component.inc b/includes/contact_component.inc index 64682aa6f..55a42a69a 100644 --- a/includes/contact_component.inc +++ b/includes/contact_component.inc @@ -253,7 +253,7 @@ function _webform_edit_civicrm_contact($component) { '#parents' => array('extra', 'default_custom_ref'), ); } - + $case_count = isset($data['case']['number_of_case']) ? $data['case']['number_of_case'] : 0; if ($case_count > 0) { $form['defaults']['default']['#options']['case_roles'] = t('Case roles'); @@ -918,8 +918,8 @@ function wf_crm_find_relations($cid, $types = array(), $current = TRUE) { } $params = [ 'return' => ['contact_id_a', 'contact_id_b', 'relationship_type_id', 'end_date'], - 'contact_id_a' => 'user_contact_id', - 'contact_id_b' => 'user_contact_id', + 'contact_id_a' => $cid, + 'contact_id_b' => $cid, 'options' => ['or' => [['contact_id_a', 'contact_id_b']]], ]; if ($type_ids) { diff --git a/includes/wf_crm_webform_ajax.inc b/includes/wf_crm_webform_ajax.inc index 397203e3d..0e4612eae 100644 --- a/includes/wf_crm_webform_ajax.inc +++ b/includes/wf_crm_webform_ajax.inc @@ -134,7 +134,7 @@ class wf_crm_webform_ajax extends wf_crm_webform_base { } } // Populate related contacts - elseif ($c == 1 && $i > $c && $field == 'existing') { + elseif ($i > $c && $field == 'existing') { $related_component = $this->getComponent($fid); if (wf_crm_aval($related_component['extra'], 'default') == 'relationship') { $old_related_cid = wf_crm_aval($this->ent, "contact:$i:id");