diff --git a/api/js/etemplate/et2_core_legacyJSFunctions.ts b/api/js/etemplate/et2_core_legacyJSFunctions.ts index 87d6aee233..1f9d62c540 100644 --- a/api/js/etemplate/et2_core_legacyJSFunctions.ts +++ b/api/js/etemplate/et2_core_legacyJSFunctions.ts @@ -71,7 +71,8 @@ export function et2_compileLegacyJS(_code, _widget, _context) } } if (typeof parent[existing_func] === "function") { - return parent[existing_func]; + // Bind the object so no matter what happens, context is correct + return parent[existing_func].bind(parent); } }