Skip to content

EspoCRM – Open Source CRM Application

Fix import

Yuriia228b97878fd
diff --git a/application/Espo/Tools/Import/Import.php b/application/Espo/Tools/Import/Import.php
index 2688597460..cba0fd61df 100644
--- a/application/Espo/Tools/Import/Import.php
+++ b/application/Espo/Tools/Import/Import.php
@@ -507,13 +507,17 @@ class Import
}
}
- $this->processAdditionalAccessCheck(
- entity: $entity,
- import: $import,
- row: $row,
- index: $index,
- errorIndex: $errorIndex,
- );
+ try {
+ $this->processAdditionalAccessCheck(
+ entity: $entity,
+ import: $import,
+ row: $row,
+ index: $index,
+ errorIndex: $errorIndex,
+ );
+ } catch (Forbidden) {
+ return ['isError' => true];
+ }
$defaultCurrency = $params->getCurrency() ?? $this->currencyConfig->getDefaultCurrency();
@@ -1455,6 +1459,7 @@ class Import
/**
* @param string[] $row
+ * @throws Forbidden
*/
private function processAdditionalAccessCheck(
CoreEntity $entity,
@@ -1484,6 +1489,8 @@ class Import
import: $import,
errorIndex: $errorIndex,
);
+
+ throw new Forbidden();
}
/**