X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FRelationship.php;h=2be985d27a538b81718e4d55b35d9e46f04d52ff;hb=dc58e61d6e80dedddf9e901c450aaea7c8120fe6;hp=50c8c7c3ce0ef9784ad0e485d22ced1c9d7336fc;hpb=34549323dc186f2fb67e4933a26c1de946a99700;p=civicrm-core.git diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 50c8c7c3ce..2be985d27a 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -207,14 +207,14 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { if ($this->_action & CRM_Core_Action::UPDATE) { if (!empty($this->_values)) { $defaults['relationship_type_id'] = $this->_rtypeId; - $defaults['start_date'] = CRM_Utils_Array::value('start_date', $this->_values); - $defaults['end_date'] = CRM_Utils_Array::value('end_date', $this->_values); - $defaults['description'] = CRM_Utils_Array::value('description', $this->_values); - $defaults['is_active'] = CRM_Utils_Array::value('is_active', $this->_values); + $defaults['start_date'] = $this->_values['start_date'] ?? NULL; + $defaults['end_date'] = $this->_values['end_date'] ?? NULL; + $defaults['description'] = $this->_values['description'] ?? NULL; + $defaults['is_active'] = $this->_values['is_active'] ?? NULL; // The postprocess function will swap these fields if it is a b_a relationship, so we compensate here - $defaults['is_permission_a_b'] = CRM_Utils_Array::value('is_permission_' . $this->_rtype, $this->_values); - $defaults['is_permission_b_a'] = CRM_Utils_Array::value('is_permission_' . strrev($this->_rtype), $this->_values); + $defaults['is_permission_a_b'] = $this->_values['is_permission_' . $this->_rtype] ?? NULL; + $defaults['is_permission_b_a'] = $this->_values['is_permission_' . strrev($this->_rtype)] ?? NULL; $defaults['is_current_employer'] = $this->_isCurrentEmployer; @@ -239,7 +239,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { 'version' => 3, ]; $note = civicrm_api('Note', 'getsingle', $noteParams); - $defaults['note'] = CRM_Utils_Array::value('note', $note); + $defaults['note'] = $note['note'] ?? NULL; } } else {