mirror of
https://github.com/discourse/discourse.git
synced 2025-04-14 21:50:57 +08:00
FIX: don't show 'About category' topics on the 404 page
This commit is contained in:
parent
fc20332c0f
commit
5bcfb6ee38
@ -339,8 +339,9 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def build_not_found_page(status=404, layout=false)
|
||||
@top_viewed = Topic.top_viewed(10)
|
||||
@recent = Topic.recent(10)
|
||||
category_topic_ids = Category.pluck(:topic_id).compact
|
||||
@top_viewed = Topic.where.not(id: category_topic_ids).top_viewed(10)
|
||||
@recent = Topic.where.not(id: category_topic_ids).recent(10)
|
||||
@slug = params[:slug].class == String ? params[:slug] : ''
|
||||
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
||||
@slug.gsub!('-',' ')
|
||||
|
Loading…
x
Reference in New Issue
Block a user