mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +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
|
// run validation method of widget implementing this custom field
|
||||||
$widget = $this->_widget($fname, $field_settings);
|
$widget = $this->_widget($fname, $field_settings);
|
||||||
$widget->validate($cname, $expand, $content, $validated);
|
$widget->validate($cname, $expand, $content, $validated);
|
||||||
|
if ($field_settings['needed'] && (is_array($value) ? !$value : (string)$value === ''))
|
||||||
if ((string)$value === '' && $field_settings['needed'])
|
|
||||||
{
|
{
|
||||||
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);
|
$valid =& self::get_array($validated, $this->id ? $form_name : $field, true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user