mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Added modifier hooks to allow plugins to tweak how categories and groups are fetched (#21837)
This commit adds modifiers that allow plugins to change how categories and groups are prefetched into the application and listed in the respective controllers. Possible use cases: - prevent some categories/groups from being prefetched when the application loads for performance reasons. - prevent some categories/groups from being listed in their respective index pages.
This commit is contained in:
@@ -630,7 +630,7 @@ class Search
|
||||
Group
|
||||
.visible_groups(@guardian.user)
|
||||
.members_visible_groups(@guardian.user)
|
||||
.where("groups.name ILIKE ? OR (id = ? AND id > 0)", match, match.to_i)
|
||||
.where("groups.name ILIKE ? OR (groups.id = ? AND groups.id > 0)", match, match.to_i)
|
||||
|
||||
DiscoursePluginRegistry.search_groups_set_query_callbacks.each do |cb|
|
||||
group_query = cb.call(group_query, @term, @guardian)
|
||||
|
||||
Reference in New Issue
Block a user