From 6b6f70e2a27ae7d48be4cee9e93948b86129296a Mon Sep 17 00:00:00 2001
From: Madhu S R <madhu.sr@vtigersolutions.com>
Date: Fri, 12 Apr 2024 14:55:45 +0530
Subject: [PATCH] multi picklist

---
 .gitignore                          | 1 +
 modules/Calendar/actions/Save.php   | 3 +++
 modules/Vtiger/actions/SaveAjax.php | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/.gitignore b/.gitignore
index 1b58a9326..585abce2b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 vendor/*
 !vendor/.htaccess
+.vscode/*
\ No newline at end of file
diff --git a/modules/Calendar/actions/Save.php b/modules/Calendar/actions/Save.php
index f6b4cf19f..01309bc37 100644
--- a/modules/Calendar/actions/Save.php
+++ b/modules/Calendar/actions/Save.php
@@ -150,6 +150,9 @@ class Calendar_Save_Action extends Vtiger_Save_Action {
 			if($fieldDataType == 'time' && $fieldValue !== null){
 				$fieldValue = Vtiger_Time_UIType::getTimeValueWithSeconds($fieldValue);
             }
+			if(is_array($fieldValue) && $fieldDataType == 'multipicklist'){
+				$fieldValue=implode(' |##| ',$fieldValue);
+			}
             // End
             if ($fieldName === $request->get('field')) {
 				$fieldValue = $request->get('value');
diff --git a/modules/Vtiger/actions/SaveAjax.php b/modules/Vtiger/actions/SaveAjax.php
index 0c5013d10..a1c5c434f 100644
--- a/modules/Vtiger/actions/SaveAjax.php
+++ b/modules/Vtiger/actions/SaveAjax.php
@@ -107,6 +107,9 @@ class Vtiger_SaveAjax_Action extends Vtiger_Save_Action {
 				if ($fieldDataType == 'time' && $fieldValue !== null) {
 					$fieldValue = Vtiger_Time_UIType::getTimeValueWithSeconds($fieldValue);
 				}
+				if(is_array($fieldValue) && $fieldDataType == 'multipicklist'){
+					$fieldValue=implode(' |##| ',$fieldValue);
+				}
                 $fieldValue = $this->purifyCkeditorField($fieldName, $fieldValue);
 				if ($fieldValue !== null) {
 					if (!is_array($fieldValue)) {
-- 
GitLab