Fix uncategorized topics not being shown on categories page
This commit is contained in:
parent
5a4b939cf7
commit
8a96c4c0f6
|
@ -103,7 +103,8 @@ class CategoryList
|
||||||
@categories.insert(insert_at || @categories.size, uncategorized)
|
@categories.insert(insert_at || @categories.size, uncategorized)
|
||||||
end
|
end
|
||||||
|
|
||||||
if @all_topics.present? && uncategorized.present?
|
if uncategorized.present?
|
||||||
|
@all_topics ||= []
|
||||||
uncategorized.displayable_topics = uncategorized_topics
|
uncategorized.displayable_topics = uncategorized_topics
|
||||||
@all_topics << uncategorized_topics
|
@all_topics << uncategorized_topics
|
||||||
@all_topics.flatten!
|
@all_topics.flatten!
|
||||||
|
|
|
@ -22,6 +22,7 @@ describe CategoryList do
|
||||||
category.slug.should == SiteSetting.uncategorized_name
|
category.slug.should == SiteSetting.uncategorized_name
|
||||||
category.topics_week.should == 1
|
category.topics_week.should == 1
|
||||||
category.featured_topics.should == [topic]
|
category.featured_topics.should == [topic]
|
||||||
|
category.displayable_topics.should == [topic] # CategoryDetailedSerializer needs this attribute
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not return an invisible topic' do
|
it 'does not return an invisible topic' do
|
||||||
|
|
Loading…
Reference in New Issue