mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Serialize parent categories first (#24530)
The parent category needs to be serialized before the child category because they are parsed in order. Otherwise the client will not build the parent-child relationship correctly.
This commit is contained in:
@@ -78,7 +78,7 @@ class TopicList
|
||||
|
||||
def categories
|
||||
@categories ||=
|
||||
topics.map { |t| [t.category, t.category&.parent_category] }.uniq.flatten.compact
|
||||
topics.map { |t| [t.category&.parent_category, t.category] }.uniq.flatten.compact
|
||||
end
|
||||
|
||||
def load_topics
|
||||
|
||||
Reference in New Issue
Block a user