Actions
Bug #19735
openPlugin API for extending template helpers does not work
Status:
New
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Description
We added extend_template_helpers
API methods but it does not work, methods added via this extension are not available in Foreman::Renderer. Rendering is not possible:
Create a plugin, add new method, try to use it in a template in both safemode and non-safemode. Result:
There was an error rendering the Discovery Red Hat kexec template: undefined local variable or method `discovery_kexec_kernel' for #<#<Class:0x0055f4717ade40>:0x0055f471772c28> Did you mean? discovery_rule_url
Updated by Lukas Zapletal over 7 years ago
- Related to Feature #14588: Improve extending template helpers from plugin added
Updated by Lukas Zapletal over 7 years ago
- Related to Refactor #19737: Kernel and initram not shown in preview mode added
Updated by Lukas Zapletal over 7 years ago
Side note: I observed that the extension mechanism is called every request, so every request we are iterating through plugins and re-including and re-extending all methods.
Updated by Marek Hulán over 7 years ago
Lukas, could you please add a reproducer? It seems to work fine for foreman_chef and I don't see how it would be called multiple times if you put this into the plugin initializer.
Actions