diff --git a/modules/Vtiger/helpers/Util.php b/modules/Vtiger/helpers/Util.php index ec0091b29189b81e7026aa741f4ce4167e259322..97bbb292af070c090b4cb1a3f7578e3697ad44e4 100644 --- a/modules/Vtiger/helpers/Util.php +++ b/modules/Vtiger/helpers/Util.php @@ -608,12 +608,12 @@ class Vtiger_Util_Helper { //Request will be having in terms of AM and PM but the database will be having in 24 hr format so converting //Database format - if($fieldInfo->getFieldDataType() == "time") { + if($fieldInfo && $fieldInfo->getFieldDataType() == "time") { $fieldValue = Vtiger_Time_UIType::getTimeValueWithSeconds($fieldValue); } $specialDateTimeConditions = Vtiger_Functions::getSpecialDateTimeCondtions(); - if($fieldName == 'date_start' || $fieldName == 'due_date' || $fieldInfo->getFieldDataType() == "datetime" && !in_array($operator, $specialDateTimeConditions) ) { + if($fieldName == 'date_start' || $fieldName == 'due_date' || ($fieldInfo && $fieldInfo->getFieldDataType() == "datetime") && !in_array($operator, $specialDateTimeConditions) ) { $dateValues = explode(',', $fieldValue); //Indicate whether it is fist date in the between condition $isFirstDate = true; @@ -633,7 +633,10 @@ class Vtiger_Util_Helper { $fieldValue = implode(',',$dateValues); } - $advFilterFieldInfoFormat['columnname'] = $fieldInfo->getCustomViewColumnName(); + if ($fieldInfo) { + $columnName = $fieldInfo->getCustomViewColumnName(); + } + $advFilterFieldInfoFormat['columnname'] = $columnName; $advFilterFieldInfoFormat['comparator'] = $operator; $advFilterFieldInfoFormat['value'] = $fieldValue; $advFilterFieldInfoFormat['column_condition'] = $groupConditionGlue;