mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Fix bugs in server side custom field validation
- Multiselects were always passing required check - Validation errors were not properly set, so weren't displayed
This commit is contained in:
parent
9c9b784c0c
commit
d81adb1d82
@ -316,10 +316,9 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
|
||||
// run validation method of widget implementing this custom field
|
||||
$widget = $this->_widget($fname, $field_settings);
|
||||
$widget->validate($cname, $expand, $content, $validated);
|
||||
|
||||
if ((string)$value === '' && $field_settings['needed'])
|
||||
if ($field_settings['needed'] && (is_array($value) ? !$value : (string)$value === ''))
|
||||
{
|
||||
self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
|
||||
self::set_validation_error($field,lang('Field must not be empty !!!'),'');
|
||||
}
|
||||
$valid =& self::get_array($validated, $this->id ? $form_name : $field, true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user