DEV: Use new API to preload category custom fields (#521)

This commit is contained in:
Bianca Nenciu 2023-11-09 18:52:04 +02:00 committed by GitHub
parent 5055bcbb2c
commit c234819131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -171,7 +171,12 @@ after_initialize do
on(:unassign_topic) { |topic, unassigning_user| Assigner.new(topic, unassigning_user).unassign }
Site.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|
if SiteSetting.assign_enabled?