mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 23:12:45 +08:00
FIX: Preload the right fields on categories (#24396)
This commit is contained in:
parent
d454d2f25e
commit
0bc568f66d
|
@ -171,12 +171,11 @@ module Chat
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.preload_custom_fields_for(channels)
|
def self.preload_custom_fields_for(channels)
|
||||||
preload_fields = Category.instance_variable_get(:@custom_field_types).keys
|
|
||||||
Category.preload_custom_fields(
|
Category.preload_custom_fields(
|
||||||
channels
|
channels
|
||||||
.select { |c| c.chatable_type == "Category" || c.chatable_type == "category" }
|
.select { |c| c.chatable_type == "Category" || c.chatable_type == "category" }
|
||||||
.map(&:chatable),
|
.map(&:chatable),
|
||||||
preload_fields,
|
Site.preloaded_category_custom_fields,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user