mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Fix Et2TreeDropdownCategory server-side validation
This commit is contained in:
parent
2c664f7f78
commit
4234afd453
@ -225,8 +225,8 @@ class Tree extends Etemplate\Widget
|
||||
{
|
||||
return (boolean)array_filter($cats, function($cat) use($id)
|
||||
{
|
||||
return $cat['id'] == $id || (
|
||||
!empty($cat['item']) && is_array($cat['item']) && static::in_cats($id, $cat['item'])
|
||||
return $cat['value'] == $id || (
|
||||
!empty($cat['children']) && is_array($cat['children']) && static::in_cats($id, $cat['children'])
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -267,7 +267,9 @@ class Tree extends Etemplate\Widget
|
||||
$this->type == 'tree' && !self::in_tree($val, $allowed))
|
||||
{
|
||||
self::set_validation_error($form_name,lang("'%1' is NOT allowed%2)!", $val,
|
||||
$this->type == 'tree-cat' ? " ('".implode("','",array_keys($allowed)).')' : ''), '');
|
||||
$this->type == 'tree-cat' ? " ('" . implode("','", array_column($allowed, 'value')) . ')' : ''
|
||||
), ''
|
||||
);
|
||||
$val = '';
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user