10000 search for block within grandparents too · drzraf/twig.js@14080d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 14080d3

Browse files
author
Raphaël Droz
authored
search for block within grandparents too
When looking for a block recursively search for grandparents too. Fix twigjs#694
1 parent de70fa3 commit 14080d3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/twig.core.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,11 @@ module.exports = function (Twig) {
12941294
if (block === undefined) {
12951295
block = this.blocks.imported[name];
12961296
}
1297+
1298+
if (block === undefined && this.parentTemplate !== null) {
1299+
// Block defined in the parent template when extending
1300+
block = this.parentTemplate.getBlock(name, checkOnlyInheritedBlocks);
1301+
}
12971302

12981303
return block;
12991304
};

0 commit comments

Comments
 (0)
0