Project

General

Profile

Actions

Feature #24297

open

Importing templates with prefix does not update references inside templates

Added by Ondřej Pražák over 5 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Clonned from Github issue: https://github.com/theforeman/foreman_templates/issues/49

Steps to reproduce:

1) set up a template repo with 'my_snippet.erb' and 'my_template.erb' that uses the snippet (<%= snippet 'my_snippet' >)
2) import repo with non-empty prefix ('My prefix ')
3) imported templates will be named 'My prefix my_snippet' and 'My prefix my_template', but template content will still have <
= snippet 'my_snippet' %>, which will lead to using non-existing snippet or a completely different one.

It should be possible to update the names of used snippets in the template when importing with prefix. We should introduce setting that allows users to switch between old and new behavior.

Actions #1

Updated by Arend Lapere over 5 years ago

I agree that this is an issue and there should be a way around that. We use prefixes as well, however, I think there are 2 cases to consider:
- Snippets referring to another imported snippet should be prefixed
- Snippets not referring to any imported snippet should not be prefixed

IMO that's the key decision factor for adding the prefix. Am I right in this conclusion? Other ideas or insights? :-)

Actions

Also available in: Atom PDF