discourse/app/controllers/admin/search_controller.rb
Alan Guo Xiang Tan 9025d98eaf
FIX: Default Locale site setting not included in admin search (#34562)
### Before
<img width="1079" height="981" alt="Screenshot 2025-08-27 at 12 20
30 PM"
src="https://github.com/user-attachments/assets/8b38ef86-e602-440f-8d59-321af1677c95"
/>

### After

<img width="1106" height="1059" alt="Screenshot 2025-08-27 at 12 20
01 PM"
src="https://github.com/user-attachments/assets/1f9e3c61-5a17-4067-ad67-2c9a2e1ba382"
/>
2025-08-27 13:03:44 +08:00

29 lines
928 B
Ruby

# frozen_string_literal: true
class Admin::SearchController < Admin::AdminController
RESULT_TYPES = %w[page setting theme component report].freeze
def index
respond_to do |format|
format.json do
render_json_dump(
settings:
SiteSetting.all_settings(
filter_names: params[:filter_names],
filter_area: params[:filter_area],
filter_plugin: params[:plugin],
filter_categories: Array.wrap(params[:categories]),
include_locale_setting:
params[:filter_area].blank? || params[:filter_area] == "localization",
basic_attributes: true,
),
themes_and_components:
serialize_data(Theme.include_relations.order(:name), BasicThemeSerializer),
reports: Reports::ListQuery.call,
)
end
format.html { render body: nil }
end
end
end