From 0fcaaa2a08d822c1cce3dabff62519954ce244ed Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 10 Jun 2022 19:09:23 +1200 Subject: [PATCH] Add integer validation to import --- CRM/Import/Parser.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index 7ec35b7c9a..d77f597234 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -1385,6 +1385,10 @@ abstract class CRM_Import_Parser { return Civi::$statics[__CLASS__][$fieldName][$importedValue] ?? 'invalid_import_value'; } } + if ($fieldMetadata['type'] === CRM_Utils_Type::T_INT) { + // We have resolved the options now so any remaining ones should be integers. + return CRM_Utils_Rule::numeric($importedValue) ? $importedValue : 'invalid_import_value'; + } return $importedValue; } -- 2.25.1