mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:12:40 +08:00
FIX: don't show 'About category' topics on the 404 page
This commit is contained in:
@ -339,8 +339,9 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def build_not_found_page(status=404, layout=false)
|
def build_not_found_page(status=404, layout=false)
|
||||||
@top_viewed = Topic.top_viewed(10)
|
category_topic_ids = Category.pluck(:topic_id).compact
|
||||||
@recent = Topic.recent(10)
|
@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[:slug].class == String ? params[:slug] : ''
|
||||||
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
||||||
@slug.gsub!('-',' ')
|
@slug.gsub!('-',' ')
|
||||||
|
Reference in New Issue
Block a user