Project

General

Profile

Actions

Bug #19735

open

Plugin API for extending template helpers does not work

Added by Lukas Zapletal almost 7 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Related issues 2 (0 open2 closed)

Related to Foreman - Feature #14588: Improve extending template helpers from plugin ClosedMarek Hulán04/12/2016Actions
Related to Discovery - Refactor #19737: Kernel and initram not shown in preview modeClosedLukas ZapletalActions
Actions #1

Updated by Lukas Zapletal almost 7 years ago

  • Related to Feature #14588: Improve extending template helpers from plugin added
Actions #2

Updated by Lukas Zapletal almost 7 years ago

  • Related to Refactor #19737: Kernel and initram not shown in preview mode added
Actions #3

Updated by Lukas Zapletal almost 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.

Actions #4

Updated by Marek Hulán almost 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

Also available in: Atom PDF