A platform for community discussion. Free, open, simple.
FIX: Ensure `<script>` handlebars templates are namespaced correctly (#18178)
David Taylorf4e1d0c54620
diff --git a/app/models/theme.rb b/app/models/theme.rbindex 4ec449ab4ae..fa981386433 100644--- a/app/models/theme.rb+++ b/app/models/theme.rb@@ -6,7 +6,7 @@ require 'json_schemer'class Theme < ActiveRecord::Baseinclude GlobalPath- BASE_COMPILER_VERSION = 62+ BASE_COMPILER_VERSION = 63attr_accessor :child_componentsdiff --git a/app/models/theme_field.rb b/app/models/theme_field.rbindex f20801df74d..a0b80685f6a 100644--- a/app/models/theme_field.rb+++ b/app/models/theme_field.rb@@ -92,7 +92,7 @@ class ThemeField < ActiveRecord::Baseif is_rawjs_compiler.append_raw_template(name, hbs_template)else- js_compiler.append_ember_template(name, hbs_template)+ js_compiler.append_ember_template("discourse/templates/#{name}", hbs_template)endrescue ThemeJavascriptCompiler::CompileError => exerrors << ex.messagediff --git a/spec/models/theme_field_spec.rb b/spec/models/theme_field_spec.rbindex 3e31fdac8a5..58154c825b3 100644--- a/spec/models/theme_field_spec.rb+++ b/spec/models/theme_field_spec.rb@@ -134,6 +134,7 @@ HTMLexpect(javascript_cache.content).to include("testing-div")expect(javascript_cache.content).to include("string_setting")expect(javascript_cache.content).to include("test text \\\" 123!")+ expect(javascript_cache.content).to include("define(\"discourse/theme-#{theme_field.theme_id}/discourse/templates/my-template\"")endit "correctly generates errors for transpiled css" do