mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 17:48:56 +01:00
fix TypeError: Cannot access offset of type string on string caused by legacy options attribute
This commit is contained in:
parent
485d6a7f40
commit
4248a85665
@ -205,9 +205,9 @@ 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['value'] == $id || (
|
return is_array($cat) && ($cat['value'] == $id || (
|
||||||
!empty($cat['children']) && is_array($cat['children']) && static::in_cats($id, $cat['children'])
|
!empty($cat['children']) && is_array($cat['children']) && static::in_cats($id, $cat['children'])
|
||||||
);
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,11 @@ class Tree extends Etemplate\Widget
|
|||||||
// we can not validate if autoloading is enabled
|
// we can not validate if autoloading is enabled
|
||||||
if (!$this->attrs['autoloading'])
|
if (!$this->attrs['autoloading'])
|
||||||
{
|
{
|
||||||
$allowed = $this->attrs['multiple'] ? array() : array('' => $this->attrs['options']);
|
$options = empty($this->attrs['options']) ? [] : explode(',', $this->attrs['options']);
|
||||||
|
$allowed = $this->attrs['multiple'] || empty($options[0]) || is_numeric($options[0]) ? [] : [[
|
||||||
|
'id' => '',
|
||||||
|
'label' => $options[0],
|
||||||
|
]];
|
||||||
$allowed += self::selOptions($form_name);
|
$allowed += self::selOptions($form_name);
|
||||||
foreach((array) $value as $val)
|
foreach((array) $value as $val)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user