Project

General

Profile

Actions

Bug #22411

closed

UnattendedController does not render global methods defined in plugins

Added by Timo Goebel almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Foreman - Bug #22615: Root password does not render with developClosedLukas Zapletal02/19/2018Actions
Actions #1

Updated by Timo Goebel almost 7 years ago

  • Subject changed from Foreman::Renderer vs to Foreman::Renderer vs UnattendedHelper
Actions #2

Updated by The Foreman Bot almost 7 years ago

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

Updated by Timo Goebel almost 7 years 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'
Actions #4

Updated by Lukas Zapletal almost 7 years ago

  • Translation missing: en.field_release set to 330
Actions #5

Updated by Timo Goebel almost 7 years ago

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

Updated by Lukas Zapletal almost 7 years ago

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

Also available in: Atom PDF