From 5bfa661a87bcd44f7f5c1d62b0e40ec5dd4fca05 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 17 Jan 2019 12:24:21 +0000 Subject: [PATCH] FIX: Theme settings are referenced in JS by `settings`, not `themeSetting` --- app/models/theme_field.rb | 2 +- lib/theme_javascript_compiler.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/theme_field.rb b/app/models/theme_field.rb index b4f7595bf96..e6951757526 100644 --- a/app/models/theme_field.rb +++ b/app/models/theme_field.rb @@ -60,7 +60,7 @@ class ThemeField < ActiveRecord::Base validates :name, format: { with: /\A[a-z_][a-z0-9_-]*\z/i }, if: Proc.new { |field| ThemeField.theme_var_type_ids.include?(field.type_id) } - COMPILER_VERSION = 7 + COMPILER_VERSION = 8 belongs_to :theme diff --git a/lib/theme_javascript_compiler.rb b/lib/theme_javascript_compiler.rb index f6b842ff8de..eef81e83281 100644 --- a/lib/theme_javascript_compiler.rb +++ b/lib/theme_javascript_compiler.rb @@ -206,7 +206,7 @@ class ThemeJavascriptCompiler template = Tilt::ES6ModuleTranspilerTemplate.new {} wrapped = <<~PLUGIN_API_JS if ('Discourse' in window && typeof Discourse._registerPluginCode === 'function') { - const themeSetting = Discourse.__container__ + const settings = Discourse.__container__ .lookup("service:theme-settings") .getObjectForTheme(#{@theme_id}); const themePrefix = (key) => `theme_translations.#{@theme_id}.${key}`;