mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
FIX: Color scheme stylesheet not loaded when no default theme is set.
Follow-up to 8e3691d537
This commit is contained in:
parent
7b31d8a11b
commit
be655762d8
|
@ -269,7 +269,6 @@ class Stylesheet::Manager
|
||||||
|
|
||||||
theme = get_theme(theme_id)
|
theme = get_theme(theme_id)
|
||||||
|
|
||||||
if theme
|
|
||||||
builder = Builder.new(
|
builder = Builder.new(
|
||||||
target: target,
|
target: target,
|
||||||
theme: get_theme(theme_id),
|
theme: get_theme(theme_id),
|
||||||
|
@ -283,9 +282,6 @@ class Stylesheet::Manager
|
||||||
stylesheet[:new_href] = href
|
stylesheet[:new_href] = href
|
||||||
cache.defer_set(cache_key, stylesheet.freeze)
|
cache.defer_set(cache_key, stylesheet.freeze)
|
||||||
stylesheet
|
stylesheet
|
||||||
else
|
|
||||||
{}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def color_scheme_stylesheet_link_tag(color_scheme_id = nil, media = 'all')
|
def color_scheme_stylesheet_link_tag(color_scheme_id = nil, media = 'all')
|
||||||
|
|
|
@ -396,13 +396,14 @@ describe Stylesheet::Manager do
|
||||||
describe 'color_scheme_stylesheets' do
|
describe 'color_scheme_stylesheets' do
|
||||||
it "returns something by default" do
|
it "returns something by default" do
|
||||||
link = manager.color_scheme_stylesheet_link_tag
|
link = manager.color_scheme_stylesheet_link_tag
|
||||||
expect(link).not_to eq("")
|
expect(link).to include("color_definitions_base")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not crash when no default theme is set" do
|
it "does not crash when no default theme is set" do
|
||||||
SiteSetting.default_theme_id = -1
|
SiteSetting.default_theme_id = -1
|
||||||
link = manager.color_scheme_stylesheet_link_tag
|
link = manager.color_scheme_stylesheet_link_tag
|
||||||
expect(link).not_to eq("")
|
|
||||||
|
expect(link).to include("color_definitions_base")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "loads base scheme when defined scheme id is missing" do
|
it "loads base scheme when defined scheme id is missing" do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user