-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.0.6, 4.1.1
-
MOODLE_400_STABLE, MOODLE_401_STABLE
Looking at the stack trace in MDL-77148 (for example) it is hard to know which template the error is coming from. Same issue if you try to follow the code in you PHP debugger.
It would be nice if there was some way easy way to find out. For example, either a comment at the top of moodledata/localcache/mustache/1675681331/boost/_Mustache_a3d87a9e8dbdfebc2971be0d53490c77.php, or possibly a different class name like __Mustache_a3d87a9e8dbdfebc2971be0d53490c77libtemplates_single_button.
I think this is doable, in one of two ways, since we already have class mustache_engine extends \Mustache_Engine in our code:
- First option. Override the getTemplateClassName method to add the extra bit to the standard class name.
- Second option. Override the compile method, so that after calling parent::compile, which returns the PHP code as a string, insert the comment after the opening <?php.
I prefer the first option, becuase it makes the template filename obvious from the stack trace, without having to go and look in localcache.
- has a non-specific relationship to
-
MDL-77182 Debug option to automatic insert HTML comments with the template name into the output
-
- Closed
-