mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-04 20:40:14 +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 (boolean)array_filter($cats, function($cat) use($id)
|
||||||
{
|
{
|
||||||
return $cat['id'] == $id || (
|
return $cat['value'] == $id || (
|
||||||
!empty($cat['item']) && is_array($cat['item']) && static::in_cats($id, $cat['item'])
|
!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))
|
$this->type == 'tree' && !self::in_tree($val, $allowed))
|
||||||
{
|
{
|
||||||
self::set_validation_error($form_name,lang("'%1' is NOT allowed%2)!", $val,
|
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 = '';
|
$val = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user