fix calendar.edit wont open, caused by new hidden attribute:

- parent can be undefined
- typo parent.getArr(a)yMgr()
- parseBoolExpression() does NOT support boolean values
- returning null gives errors later on, commented it out for now :(
This commit is contained in:
ralf 2023-09-22 10:28:00 +02:00
parent 92cf528fe8
commit e3138fe886
2 changed files with 8 additions and 3 deletions

View File

@ -1457,9 +1457,9 @@ export function loadWebComponent(_nodeName : string, _template_node : Element|{[
}
// Don't need to create hidden elements
if(parent.hidden || attrs["hidden"] && parent.getArrayMgr("content") && parent.getArryMgr("content").parseBoolExpression(attrs["hidden"]))
if(parent?.hidden || attrs["hidden"] && parent?.getArrayMgr("content") && parent.getArrayMgr("content").parseBoolExpression(attrs["hidden"]))
{
return null;
//return null;
}
const readonly = parent?.getArrayMgr("readonlys") ?

View File

@ -349,8 +349,13 @@ export class et2_arrayMgr
return _ident;
}
parseBoolExpression(_expression : string)
parseBoolExpression(_expression : string|number|boolean|undefined)
{
if (typeof _expression === "boolean")
{
return _expression;
}
if(typeof _expression === "undefined" || _expression === null)
{
return false;