[FIX] components: properly differentiate t-call subcomponents

Before this commit, when using a dynamic t-call, it was possible to have
a collision between subcomponent keys. This would cause hard to
understand owl crash, because owl would incorrectly use the same
component instance for two different template location. From
owl point of view, one of these component has to be destroyed and the
other one should be mounted, so a crash would occur.

The fix is to simply properly key sub components.
This commit is contained in:
Géry Debongnie
2023-04-28 14:23:19 +02:00
committed by Sam Degueldre
parent 606d14a399
commit aabb7559b8
3 changed files with 78 additions and 1 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ export class TemplateSet {
callTemplate(owner: any, subTemplate: string, ctx: any, parent: any, key: any): any {
const template = this.getTemplate(subTemplate);
return toggler(subTemplate, template.call(owner, ctx, parent, key));
return toggler(subTemplate, template.call(owner, ctx, parent, key + subTemplate));
}
}