Skip to content
Snippets Groups Projects

Fixes::handled trim function for both string and array values

Closed yogeshwar requested to merge yogeshwar/vtigercrm:292780 into master
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -41,7 +41,10 @@ class Settings_Webforms_Save_Action extends Settings_Vtiger_Index_Action {
if (!$fieldValue) {
$fieldValue = $fieldModel->get('defaultvalue');
}
if($fieldModel->isMandatory() && empty(trim($fieldValue))) {
$fieldValue=is_array($fieldValue)?array_map('trim', $fieldValue):trim($fieldValue);
if($fieldModel->isMandatory() && empty($fieldValue)) {
throw new AppException(vtranslate('LBL_MANDATORY_FIELD_MISSING'));
}else if($fieldName == 'targetmodule' && !array_key_exists($fieldValue,$supportedModules)){
throw new Exception('Target module is not supported to create webform');
Loading