mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: fix issue variables set in body of t-call
The body of a t-call directive may be used to define private variables to the sub template call. However, the code that handles t-call worked like this: - compile sub template if necessary - then compile body of t-call to extract variables This means that the variables defined in the t-call body were not yet processed and available in the context. Because of that, when the call to t-esc is done, there is not internal qweb var, and the code simply outputs a scope['varname'], which is in our case a VDOMArray, so it is displayed as [object object] What this fix does is changing the way t-esc works: if we are in the context of a sub template, then it assumes that any outside variable may or may not be a VDomArray, so it needs to check and eventually convert it to a string, if necessary. closes #719
This commit is contained in:
@@ -22,6 +22,7 @@ export class CompilationContext {
|
||||
shouldDefineUtils: boolean = false;
|
||||
shouldDefineRefs: boolean = false;
|
||||
shouldDefineResult: boolean = true;
|
||||
isSubTemplate: boolean = false;
|
||||
loopNumber: number = 0;
|
||||
inPreTag: boolean = false;
|
||||
templateName: string;
|
||||
|
||||
Reference in New Issue
Block a user