From e34ceeb583ca46c8616dca4136040232d4f4562e Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 5 May 2022 07:49:53 +1200 Subject: [PATCH] [REF] [Import] Trivial - simplify variable Assign this->activeFields[i]->_relatedContactType to a variable rather than keep repeating it. --- CRM/Contact/Import/Parser/Contact.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index d6da01174b..4e1d5e406b 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -2933,6 +2933,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { continue; } $relatedContactFieldName = $this->_activeFields[$i]->_relatedContactDetails; + $relatedContactType = $this->_activeFields[$i]->_relatedContactType; if (isset($this->_activeFields[$i]->_value)) { if (isset($this->_activeFields[$i]->_hasLocationType)) { @@ -2977,8 +2978,8 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { $params[$this->_activeFields[$i]->_related] = []; } - if (!isset($params[$this->_activeFields[$i]->_related]['contact_type']) && !empty($this->_activeFields[$i]->_relatedContactType)) { - $params[$this->_activeFields[$i]->_related]['contact_type'] = $this->_activeFields[$i]->_relatedContactType; + if (!isset($params[$this->_activeFields[$i]->_related]['contact_type']) && !empty($relatedContactType)) { + $params[$this->_activeFields[$i]->_related]['contact_type'] = $relatedContactType; } if (isset($this->_activeFields[$i]->_relatedContactLocType) && !empty($this->_activeFields[$i]->_value)) { -- 2.25.1