mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 13:37:37 +08:00
3f908c047d
When a theme setting of type `upload` has a default upload, it should return the URL of the specified default upload until a custom upload is used for the setting. However, currently this isn't the case and we get null instead of the default upload URL.
The reason for this is because the `super` method of `#value` already returns the default upload URL (if there's one), so we can't pass that to `cdn_url` which expects an upload ID:
c961dcc757/lib/theme_settings_manager.rb (L212)
This commit fixes the bug by skipping the call to `cdn_url` when we fallback to the default upload for the setting value.
87 lines
1.4 KiB
YAML
87 lines
1.4 KiB
YAML
boolean_setting: true
|
|
|
|
boolean_setting_02:
|
|
default: false
|
|
|
|
string_setting: "string value"
|
|
|
|
string_setting_02:
|
|
default: "string value"
|
|
min: 2
|
|
max: 20
|
|
|
|
string_setting_03:
|
|
default: "string value"
|
|
textarea: true
|
|
|
|
integer_setting: 51
|
|
|
|
integer_setting_02:
|
|
type: integer
|
|
default: 51
|
|
min: 1
|
|
max: 60
|
|
description:
|
|
fr: "French text"
|
|
es: "Spanish text"
|
|
|
|
integer_setting_03:
|
|
default: 15
|
|
max: 60
|
|
description:
|
|
xyz: "invalid language"
|
|
|
|
float_setting:
|
|
default: 2.5
|
|
min: 1.5
|
|
max: 10
|
|
|
|
list_setting:
|
|
type: list
|
|
description: "help text"
|
|
default: "name|age|last name"
|
|
|
|
compact_list_setting:
|
|
type: list
|
|
list_type: compact
|
|
description: "help text"
|
|
default: "name|age|last name"
|
|
|
|
enum_setting:
|
|
default: "trust level 4"
|
|
type: enum
|
|
choices:
|
|
- "trust level 0"
|
|
- "trust level 1"
|
|
|
|
enum_setting_02:
|
|
type: enum
|
|
default: 10
|
|
description:
|
|
en: "English text"
|
|
ar: "Arabic text"
|
|
|
|
enum_setting_03:
|
|
type: enum
|
|
default: 1
|
|
choices:
|
|
- 10
|
|
- 100
|
|
- 1000
|
|
|
|
upload_setting:
|
|
type: upload
|
|
default: "default-upload"
|
|
|
|
invalid_json_schema_setting:
|
|
default: ""
|
|
json_schema: '{ "type": "array", "invalid json"'
|
|
|
|
valid_json_schema_setting:
|
|
default: ""
|
|
json_schema: '{ "type": "array", "uniqueItems": true, "items": { "type": "object", "properties": { "color": { "type": "string" }, "icon": { "type": "string" } }, "additionalProperties": false } }'
|
|
|
|
causes_refresh:
|
|
default: ""
|
|
refresh: true
|