Project

General

Profile

Bug #24503

snippets macro does not render a snippet partial from filesystem

Added by Timo Goebel 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
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

Related to Foreman - Refactor #22529: Refactor Template rendering to use a proper rendering serviceClosed

Associated revisions

Revision dca37b20 (diff)
Added by Timo Goebel 4 months ago

fixes #24503 - remove snippets macro

History

#1 Updated by Timo Goebel 5 months ago

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

#2 Updated by The Foreman Bot 5 months ago

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

#3 Updated by Tomer Brisker 4 months ago

  • Fixed in Releases 1.20.0 added

#4 Updated by Timo Goebel 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF