From 1596bec75c9ff0f11df8d744168735e6a124ed33 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 19 Aug 2021 10:22:40 +0200 Subject: [PATCH] get form::name() legacy function working by making used et2_form_name function global, if used --- api/js/etemplate/et2_core_legacyJSFunctions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_core_legacyJSFunctions.ts b/api/js/etemplate/et2_core_legacyJSFunctions.ts index 0f46665b2a..87d6aee233 100644 --- a/api/js/etemplate/et2_core_legacyJSFunctions.ts +++ b/api/js/etemplate/et2_core_legacyJSFunctions.ts @@ -17,6 +17,7 @@ import {egw} from "../jsapi/egw_global"; import {et2_IDOMNode} from "./et2_core_interfaces"; +import {et2_form_name} from "./et2_core_common"; export function et2_compileLegacyJS(_code, _widget, _context) { @@ -144,7 +145,8 @@ function js_pseudo_funcs(_val,widget) { // et2_form_name doesn't care about ][, just [ var _cname = widget.getPath() ? widget.getPath().join("[") : false; - _val = _val.replace(/form::name\(/g, "'"+widget.getRoot()._inst.uniqueId+"_'+"+(_cname ? "et2_form_name('"+_cname+"'," : '(')); + document.et2_form_name = et2_form_name; + _val = _val.replace(/form::name\(/g, "'"+widget.getRoot()._inst.uniqueId+"_'+"+(_cname ? "document.et2_form_name('"+_cname+"'," : '(')); } if (_val.indexOf('egw::lang(') != -1)