mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 20:48:15 +08:00
Merge pull request #1890 from vikhyat/hidden-category-fix
ignore exclude_category from the menu if we are trying to view the category
This commit is contained in:
@ -199,9 +199,9 @@ class ListController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def build_topic_list_options
|
def build_topic_list_options
|
||||||
# html format means we need to parse exclude category (aka filter) from the site options top menu
|
|
||||||
menu_items = SiteSetting.top_menu_items
|
menu_items = SiteSetting.top_menu_items
|
||||||
menu_item = menu_items.select { |item| item.query_should_exclude_category?(action_name) }.first
|
menu_item = menu_items.select { |item| item.query_should_exclude_category?(action_name) }.first
|
||||||
|
menu_item = nil if menu_item.try(:filter).try(:parameterize) == params[:category]
|
||||||
|
|
||||||
# exclude_category = 1. from params / 2. parsed from top menu / 3. nil
|
# exclude_category = 1. from params / 2. parsed from top menu / 3. nil
|
||||||
options = {
|
options = {
|
||||||
|
Reference in New Issue
Block a user