mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: do not crash in some rare t-call situation
Before this commit, QWeb crashed when it had to deal with a t-call with multiple sub nodes on the same line, and one text node: <t t-call="SomeTemplate"> <span>hey</span> <span>hey</span> </t> This was because we need to compile the content to be able to extract all possible t-set t-value statements. But doing so means that we had a multiple root templates, which caused a crash in this case. Solving this issue is simple: the sub template is compiled with the flag allowMultipleRoots set to true.
This commit is contained in:
@@ -200,6 +200,7 @@ QWeb.addDirective({
|
||||
// extract variables from nodecopy
|
||||
const tempCtx = new Context();
|
||||
tempCtx.nextID = ctx.rootContext.nextID;
|
||||
tempCtx.allowMultipleRoots = true;
|
||||
qweb._compileNode(nodeCopy, tempCtx);
|
||||
const vars = Object.assign({}, ctx.variables, tempCtx.variables);
|
||||
ctx.rootContext.nextID = tempCtx.nextID;
|
||||
|
||||
Reference in New Issue
Block a user