From 4bb91754ad43540efd9c34e093545d4caffcb0ef Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 6 Dec 2021 01:55:34 +0100 Subject: [PATCH] FIX: Make user themes sort order case insensitive (#15193) That's the order they appear in a dropdown in user preferences. --- app/serializers/site_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/site_serializer.rb b/app/serializers/site_serializer.rb index c7d8d5d66c2..29972ae8f57 100644 --- a/app/serializers/site_serializer.rb +++ b/app/serializers/site_serializer.rb @@ -42,7 +42,7 @@ class SiteSerializer < ApplicationSerializer cache_fragment("user_themes") do Theme.where('id = :default OR user_selectable', default: SiteSetting.default_theme_id) - .order(:name) + .order("lower(name)") .pluck(:id, :name, :color_scheme_id) .map { |id, n, cs| { theme_id: id, name: n, default: id == SiteSetting.default_theme_id, color_scheme_id: cs } } .as_json