Skip to content

EspoCRM – Open Source CRM Application

Import re-use with multiple defaults fix

Yuriic2e102bac378
diff --git a/application/Espo/Tools/Import/Params.php b/application/Espo/Tools/Import/Params.php
index f78d2172f1..a72cfbcf1d 100644
--- a/application/Espo/Tools/Import/Params.php
+++ b/application/Espo/Tools/Import/Params.php
@@ -63,6 +63,8 @@ class Params
private ?string $timezone = null;
private ?string $decimalMark = null;
private ?string $phoneNumberCountry = null;
+ /** @var string[]|null */
+ private ?array $defaultFieldList = null;
private function __construct()
{
@@ -255,6 +257,18 @@ class Params
return $obj;
}
+ /**
+ * @param string[] $fieldList
+ * @return self
+ */
+ public function withDefaultFieldList(?array $fieldList = null): self
+ {
+ $obj = clone $this;
+ $obj->defaultFieldList = $fieldList;
+
+ return $obj;
+ }
+
/**
* @param int[] $updateBy
*/
@@ -348,6 +362,7 @@ class Params
->withDateFormat($raw->dateFormat ?? null)
->withDecimalMark($raw->decimalMark ?? null)
->withDefaultValues($raw->defaultValues ?? null)
+ ->withDefaultFieldList($raw->defaultFieldList ?? null)
->withDelimiter($raw->delimiter ?? null)
->withHeaderRow($raw->headerRow ?? false)
->withIdleMode($raw->idleMode ?? false)
@@ -387,6 +402,7 @@ class Params
'timeFormat' => $this->timeFormat,
'timezone' => $this->timezone,
'updateBy' => $this->updateBy,
+ 'defaultFieldList' => $this->defaultFieldList,
];
}
}
diff --git a/client/src/views/import/step2.js b/client/src/views/import/step2.js
index e55ceddcc3..ada7b811b2 100644
--- a/client/src/views/import/step2.js
+++ b/client/src/views/import/step2.js
@@ -252,8 +252,8 @@ class Step2ImportView extends View {
}
resetFieldFilterQuickSearch() {
- this.$fieldQuickSearch.val('');
- this.$defaultFieldList.find('li.item').removeClass('hidden');
+ this.$fieldQuickSearch?.val('');
+ this.$defaultFieldList?.find('li.item')?.removeClass('hidden');
}
initQuickSearchUi() {