Skip to content

Commit

Permalink
DEV: Use new API to preload category custom fields (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbianca authored Nov 9, 2023
1 parent 5055bcb commit c234819
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ module ::DiscourseAssign

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?
Expand Down

0 comments on commit c234819

Please sign in to comment.