From 7f3b17b6849a99f3412cad346a6b94108330baf6 Mon Sep 17 00:00:00 2001
From: satish <satish.dvnk@vtiger.com>
Date: Tue, 13 Feb 2018 16:41:07 +0530
Subject: [PATCH] Fix #664: Missed changes of Alert pre-requisite for CSV
 import ahead than silent failure

Fixed default csv selection import
---
 modules/Vtiger/views/Import.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/Vtiger/views/Import.php b/modules/Vtiger/views/Import.php
index c30168cc4..901b723b7 100644
--- a/modules/Vtiger/views/Import.php
+++ b/modules/Vtiger/views/Import.php
@@ -129,6 +129,13 @@ class Vtiger_Import_View extends Vtiger_Index_View {
 		}
 		//End
 
+		$fileFormat = $request->get('fileFormat');
+		if (!$fileFormat || !in_array($fileFormat, $supportedFileTypes)) {
+			$fileFormat = 'csv';
+		} else {
+			$fileFormat = strtolower($fileFormat);
+		}
+
 		// Pre-conditional check for CSV import.
 		if ($fileFormat == 'csv') {
 			$isLocalInfileEnabled = Vtiger_Util_Helper::checkDbLocalInfileSupport();
@@ -146,7 +153,7 @@ class Vtiger_Import_View extends Vtiger_Index_View {
 			$viewer->assign('CURRENCIES', getAllCurrencies());
 		}
 
-		$viewer->assign('FORMAT', $request->get('fileFormat'));
+		$viewer->assign('FORMAT', $fileFormat);
 		return $viewer->view('ImportBasicStep.tpl', 'Import');
 	}
 
-- 
GitLab