2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-04 01:15:08 +08:00
discourse/spec/fixtures/site_settings/object_settings.yml
Gabriel Grubba 6800d63bfc
FIX: type object setting not redirecting on saving (#36150)
With https://github.com/discourse/discourse/pull/35349, now site
settings do not return a body on update, which broke the type object
setting editor's save flow. This commit adds handling for that case.

And also adds testing to ensure that after saving the setting, we are
redirected to another page.

Renamed `admin_objects_theme_setting_editor` to
`admin_objects_setting_editor` since it can be used for both themes and
settings.


Before:


https://github.com/user-attachments/assets/5e019428-e126-4084-80a6-eb324c851427


Now:


https://github.com/user-attachments/assets/9ac59ca2-1896-490a-866c-630a5a201471

A future todo would be to migrate [ThemeController#update_single_setting
](71834c898f/app/controllers/admin/themes_controller.rb (L343-L365))
to use the same pattern as
[`SiteSettingController#update`](d8e7741d96/app/controllers/admin/site_settings_controller.rb (L25-L53))
2025-11-21 10:26:08 -03:00

21 lines
438 B
YAML

category:
objects_setting:
type: objects
default: []
schema:
name: section
properties:
name:
type: string
required: true
links:
type: objects
schema:
name: link
properties:
name:
type: string
validations:
max_length: 20
url:
type: string