From fecfee4b41ce6461c60fa9f11e9a6d9415e5f094 Mon Sep 17 00:00:00 2001
From: Madhu S R <madhu.sr@vtigersolutions.com>
Date: Tue, 30 Apr 2024 10:24:52 +0530
Subject: [PATCH] Fixes: Removed the coparision of empty string with the
 nexttrigger_time to avoid MySQL error

---
 modules/com_vtiger_workflow/VTWorkflowManager.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/com_vtiger_workflow/VTWorkflowManager.inc b/modules/com_vtiger_workflow/VTWorkflowManager.inc
index 35a3c2aec..6766a56b3 100644
--- a/modules/com_vtiger_workflow/VTWorkflowManager.inc
+++ b/modules/com_vtiger_workflow/VTWorkflowManager.inc
@@ -87,7 +87,8 @@ class VTWorkflowManager{
 		$query = 'SELECT * FROM com_vtiger_workflows INNER JOIN vtiger_tab ON vtiger_tab.name = com_vtiger_workflows.module_name WHERE vtiger_tab.presence IN (0,2) AND execution_condition = ? AND status=?';
 		$params = array(VTWorkflowManager::$ON_SCHEDULE,1);
 		if($referenceTime != '') {
-			$query .= " AND (nexttrigger_time = '' OR nexttrigger_time IS NULL OR nexttrigger_time <= ?)";
+			//Removed the coparision of empty string with the nexttrigger_time to avoid MySQL error INCORRECT DATE TIME VALUE
+			$query .= " AND (nexttrigger_time IS NULL OR nexttrigger_time <= ?)";
 			array_push($params, $referenceTime);
 		}
 		$result = $adb->pquery($query, $params);
-- 
GitLab