Closed renderTemplate function is loading the unmodified version of a modified template

Siropu

Well-known member
Licensed customer
Affected version
2.3.5
Using the following code, renderTemplate will load the original version instead of the modified version.

PHP:
$templater = \XF::app()->templater();
$templater->addDefaultParam('xf', \XF::app()->getGlobalTemplateData());
$templater->renderTemplate('public:modified_template_name');
 
I think we might need some more context with this. What you're describing shouldn't be possible, but it might depend on some other factors.
 
I'm using this to load a template in my add-on via an AJAX request but I have tested this without AJAX in a controller using print_r for a different template that I have manually modified and the result was the same, it will load the unmodified version of it.
 
Automated triage: As designed

Thank you for reporting this issue. Before a page is rendered, the template system has not yet been told which style to use, so it falls back to the master style's copy of the template, without any edits made in your own style. Setting the style on the templater before rendering, or rendering through a normal view reply, loads the customised version.

This is an automated assessment. A member of staff may review and update it.
 
Back
Top Bottom