From f6e45d8a6833489633eb47523822fcf05ea78cf4 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 14 Aug 2014 13:40:41 +0300 Subject: [PATCH] fix import id --- application/Espo/Services/Import.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/Espo/Services/Import.php b/application/Espo/Services/Import.php index 120efd2e97..bc532cd6cd 100644 --- a/application/Espo/Services/Import.php +++ b/application/Espo/Services/Import.php @@ -242,10 +242,13 @@ class Import extends \Espo\Core\Services\Base foreach ($fields as $i => $field) { if (!empty($field)) { + $value = $row[$i]; if ($field == 'id') { + if ($params['action'] == 'create') { + $entity->id = $value; + } continue; - } - $value = $row[$i]; + } if (array_key_exists($field, $fieldsDefs)) { if ($value !== '') { $type = $this->getMetadata()->get("entityDefs.{$scope}.fields.{$field}.type");