From afdc874df901d3465452f12ce9e17ccf071f67f9 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 16 Nov 2023 15:01:31 +0200 Subject: [PATCH] import: strip separator for int --- application/Espo/Tools/Import/Import.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/Espo/Tools/Import/Import.php b/application/Espo/Tools/Import/Import.php index 2a3b06f0d7..82d36bfbb6 100644 --- a/application/Espo/Tools/Import/Import.php +++ b/application/Espo/Tools/Import/Import.php @@ -991,7 +991,14 @@ class Import return floatval($left); case Entity::INT: - if (!is_numeric($value)) { + $replaceList = [ + ' ', + $decimalMark === '.' ? ',' : '.', + ]; + + $value = str_replace($replaceList, '', $value); + + if (str_contains($value, $decimalMark) || !is_numeric($value)) { throw ValidationError::create( new Failure($entity->getEntityType(), $attribute, 'valid') );