Project

General

Profile

Bug #22411

UnattendedController does not render global methods defined in plugins

Added by Timo Goebel 7 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

UnattendedController includes Foreman::Renderer while TemplatesController includes UnattendedHelper (which itself includes Foreman::Renderer).
This can cause issues because the plugin macro extend_template_helpers extends UnattendedHelper and the methods aren't available in UnattendedController.


Related issues

Related to Foreman - Bug #22615: Root password does not render with developClosed2018-02-19

Associated revisions

Revision 4fb3d7c3 (diff)
Added by Timo Goebel 6 months ago

fixes #22411 - unattended: render template macros from plugins

History

#1 Updated by Timo Goebel 7 months ago

  • Subject changed from Foreman::Renderer vs to Foreman::Renderer vs UnattendedHelper

#2 Updated by The Foreman Bot 7 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5210 added

#3 Updated by Timo Goebel 7 months ago

  • Subject changed from Foreman::Renderer vs UnattendedHelper to UnattendedController does not render global methods defined in plugins

The issue, I see is the following. I (properly) defined template macro from a plugin (transpile_container_linux_config) works fine in preview but not when a template is rendered via the unattended controller. Instead, it gives this error:

ActionView::Template::Error: undefined method `transpile_container_linux_config' for #<#&lt;Class:0x00007f9ee7fa5b30&gt;:0x00007f9ef0398028>
13:41:38 rails.1 | | Kickstart default clone:2:in `render_safe'
13:41:38 rails.1 | | /Users/f0218175/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/erb.rb:885:in `eval'
13:41:38 rails.1 | | /Users/f0218175/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/erb.rb:885:in `result'
13:41:38 rails.1 | | /Users/f0218175/foremandev/foreman/lib/foreman/renderer.rb:98:in `render_safe'
13:41:38 rails.1 | | /Users/f0218175/foremandev/foreman/lib/foreman/renderer.rb:205:in `unattended_render'
13:41:38 rails.1 | | inline template:1:in `_187d7febb380e19c2aad384a2281b7db'

#4 Updated by Lukas Zapletal 6 months ago

  • Legacy Backlogs Release (now unused) set to 330

#5 Updated by Timo Goebel 6 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#6 Updated by Lukas Zapletal 6 months ago

  • Related to Bug #22615: Root password does not render with develop added

Also available in: Atom PDF