From 14ceb71d9f713b9196327392588047467fe9f48b Mon Sep 17 00:00:00 2001 From: Uma <uma.s@vtiger.com> Date: Fri, 3 Jul 2020 19:38:51 +0530 Subject: [PATCH] Fixes #1323 Roles based picklist values selection --- modules/Settings/Picklist/models/Module.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/Settings/Picklist/models/Module.php b/modules/Settings/Picklist/models/Module.php index 8cab658fc..81f5e76e9 100644 --- a/modules/Settings/Picklist/models/Module.php +++ b/modules/Settings/Picklist/models/Module.php @@ -284,8 +284,10 @@ class Settings_Picklist_Module_Model extends Vtiger_Module_Model { $deleteValueList[] = ' ( roleid = "'.$roleId.'" AND '.'picklistvalueid = "'.$pickListValueId.'") '; } } - $query = 'INSERT IGNORE INTO vtiger_role2picklist (roleid,picklistvalueid,picklistid) VALUES '. implode(",", $insertValueList); - $result = $db->pquery($query, array()); + if(!empty($insertValueList)){ + $insertQuery = 'INSERT IGNORE INTO vtiger_role2picklist (roleid,picklistvalueid,picklistid) VALUES '. implode(",", $insertValueList); + $result = $db->pquery($insertQuery, array()); + } if(!empty($deleteValueList)){ $deleteQuery = 'DELETE FROM vtiger_role2picklist WHERE '.implode(' OR ',$deleteValueList); -- GitLab