From e1eaeab938bef8101dcbe3caa063877406ab5427 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 24 Dec 2022 11:03:42 +0200 Subject: [PATCH] fix import null related name --- application/Espo/Tools/Import/Import.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/Espo/Tools/Import/Import.php b/application/Espo/Tools/Import/Import.php index a842fa9aaa..546c74bece 100644 --- a/application/Espo/Tools/Import/Import.php +++ b/application/Espo/Tools/Import/Import.php @@ -630,6 +630,12 @@ class Import private function processForeignName(CoreEntity $entity, string $attribute): void { + $nameValue = $entity->get($attribute); + + if ($nameValue === null) { + return; + } + $relation = $entity->getAttributeParam($attribute, 'relation'); if (!$relation) { @@ -671,8 +677,6 @@ class Import return; } - $nameValue = $entity->get($attribute); - if ($isPerson) { $where = $this->parsePersonName($nameValue, $this->params->getPersonNameFormat() ?? ''); }