Bug #18227

Snippet with variables does not reset @vars after they finish in unsafe mode

Added by Marek Hulán over 1 year ago. Updated 9 days ago.

Status:Closed
Priority:Normal
Assignee:Marek Hulán
Category:Templates
Target version:1.15.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/4222

Description

If we have a template such as

<%= snippet 'test', :variables => { :var => 'value' }
<%= @var %>

the @var would be set by the template which can cause problems later. This only happens in unsafe mode where we use the same context for each rendering. We need to split local context variables and reset them after this local context is rendered.


Related issues

Related to Foreman - Feature #18143: Snippet macros should support passing variables Closed 01/18/2017

Associated revisions

Revision e7603faf
Added by Marek Hulán over 1 year ago

Fixes #18227 - clean up variables after rendering

History

#1 Updated by Marek Hulán over 1 year ago

  • Related to Feature #18143: Snippet macros should support passing variables added

#2 Updated by The Foreman Bot over 1 year ago

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

#3 Updated by Marek Hulán over 1 year ago

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

#4 Updated by Dominic Cleal over 1 year ago

  • Legacy Backlogs Release (now unused) set to 209

Also available in: Atom PDF