Project

General

Profile

Actions

Bug #24503

closed

snippets macro does not render a snippet partial from filesystem

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

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

Description

The snippets macro does not work anymore. It errors with "undefined method: render".

I believe it hasn't worked before as it tried to render a snippet from `app/views/unattended/snippets`, but the folder does not exist.

If I revert the template scope refactoring and create the folder, it errors with "AbstractController::DoubleRenderError in ProvisioningTemplatesController#preview"

In addition, the method is potentially dangerous as it allows a user to use ../

<%= snippets('../provisioning_templates/snippet/puppet.conf') %>

I was not able to break out of app/views but I guess we should not rely on that.


Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #22529: Refactor Template rendering to use a proper rendering serviceClosedTimo GoebelActions
Actions #1

Updated by Timo Goebel almost 6 years ago

  • Related to Refactor #22529: Refactor Template rendering to use a proper rendering service added
Actions #2

Updated by The Foreman Bot almost 6 years ago

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

Updated by Tomer Brisker almost 6 years ago

  • Fixed in Releases 1.20.0 added
Actions #4

Updated by Timo Goebel almost 6 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF