From 194c84b217f8246ea71e8a8bef2ce0e88f922ca3 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Mon, 18 Dec 2023 11:42:55 +1000 Subject: [PATCH] FIX: Sort plugin list by name properly (#24839) Some plugins have discourse- prefixed on their name and some don't, so sorting in the list was inconsistent. --------- Co-authored-by: Ted Johansson --- app/controllers/admin/plugins_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/plugins_controller.rb b/app/controllers/admin/plugins_controller.rb index 202019844b9..2a1ce6b051e 100644 --- a/app/controllers/admin/plugins_controller.rb +++ b/app/controllers/admin/plugins_controller.rb @@ -2,6 +2,10 @@ class Admin::PluginsController < Admin::StaffController def index - render_serialized(Discourse.visible_plugins, AdminPluginSerializer, root: "plugins") + render_serialized( + Discourse.visible_plugins.sort_by { |p| p.name.downcase.delete_prefix("discourse-") }, + AdminPluginSerializer, + root: "plugins", + ) end end