From 94555d9fa50bf13c745c2509f6972fed03551e17 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Thu, 16 Aug 2012 12:04:40 +0000 Subject: [PATCH] [-] BO : fixed issue with dot and comma in import for floating numbers #PSCFV-3609 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16866 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminImportController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 9fe533e4d..520b7d8ca 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -760,7 +760,13 @@ class AdminImportControllerCore extends AdminController $entity->{$key}[$id_lang_tmp] = $value; } else + { + // If the type is float, we need to cast it in order to avoid problem with "," and ".". + $class = get_class($entity); + if (isset($class::$definition['fields'][$key]['type']) && $class::$definition['fields'][$key]['type'] == ObjectModel::TYPE_FLOAT) + $infos = (float)$infos; $entity->{$key} = isset(self::$validators[$key]) ? call_user_func(self::$validators[$key], $infos) : $infos; + } return true; } @@ -2669,5 +2675,4 @@ class AdminImportControllerCore extends AdminController die; } } -} - +} \ No newline at end of file