diverse fixes loading no longer existing legacy widgets like description

This commit is contained in:
ralf
2022-05-13 15:32:36 +02:00
parent ac5932240b
commit 273fe9a28a
6 changed files with 44 additions and 19 deletions

View File

@ -47,6 +47,17 @@ export function et2_loadXMLFromURL(_url : string, _callback? : Function, _contex
{
win = egw.top;
}
// if preprocessor is missing --> add it
if (_url.indexOf('/etemplate.php/') === -1)
{
const parts = _url.match(/^(.*)(\/[^/]+\/templates\/.*)$/);
if (parts)
{
_url = parts[1]+'/api/etemplate.php'+parts[2];
}
}
// we add the full url (protocol and domain) as sometimes just the path
// gives a CSP error interpreting it as file:///path
// (if there are a enough 404 errors in html content ...)
@ -113,7 +124,4 @@ export function et2_readAttrWithDefault(_node : HTMLElement, _name : string, _de
let val = _node.getAttribute(_name);
return (val === null) ? _default : val;
}
}