Merge branch 'MDL-84076-MOODLE_405_STABLE' of https://github.com/PhMemmel/moodle into MOODLE_405_STABLE

This commit is contained in:
Huong Nguyen
2025-09-10 09:10:16 +07:00
3 changed files with 6 additions and 4 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -550,12 +550,14 @@ export default class Renderer {
Renderer.getLoader().getTemplate(iconTemplate, themeName),
]);
this.addHelpers(context, themeName);
// Clone context object to avoid manipulating the original context object.
const templateContext = {...context};
this.addHelpers(templateContext, themeName);
// Render the template.
const renderedContent = await mustache.render(
templateSource,
context,
templateContext,
// Note: The third parameter is a function that will be called to process partials.
(partialName) => Renderer.getLoader().partialHelper(partialName, themeName),
);