From 93c6add9d846a9ddc9865f7e7c0762face9b5864 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Thu, 9 Nov 2023 18:29:19 +0200 Subject: [PATCH] Update plugin.rb --- plugin.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin.rb b/plugin.rb index a0030eec..2c807828 100644 --- a/plugin.rb +++ b/plugin.rb @@ -167,9 +167,11 @@ module ::DiscourseAssign on(:unassign_topic) { |topic, unassigning_user| Assigner.new(topic, unassigning_user).unassign } - Site.preloaded_category_custom_fields << "enable_unassigned_filter" - if self.respond_to?(:register_category_list_preloaded_category_custom_fields) - register_category_list_preloaded_category_custom_fields("enable_unassigned_filter") + if respond_to?(:register_preloaded_category_custom_fields) + register_preloaded_category_custom_fields("enable_unassigned_filter") + else + # TODO: Drop the if-statement and this if-branch in Discourse v3.2 + Site.preloaded_category_custom_fields << "enable_unassigned_filter" end BookmarkQuery.on_preload do |bookmarks, bookmark_query|