Bug 23237: Plugin allow [% INCLUDE %] from template
From a plugin template it is useful to be able to include other templates with
[% INCLUDE %] directives. But TT module is used by Koha with absolute paths.
Relative paths are forbidden for security reasons. A new param [% PLUGIN_DIR %]
allow plugin templates to know where to find plugin home directory.
How to test:
1. Install kitchen-sink plugin.
2. Find tool-step1.tt file, and add this at the begining of the file:
[% INCLUDE "$PLUGIN_DIR/header.tt" %]
It ask to include a template header.tt which doesn't exit.
3. Run kitchen-sink plugin tool. You must have this error message:
Template process failed: file error - _path to plugin
directory_/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/header.tt: not found
quod erat demonstrandum
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit
8c517d2f2860c08263f44dfde8d3cadea418694e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>