mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 17:26:07 +08:00
FIX: Handle sub-sub-category paths without an id
This commit is contained in:
@ -319,9 +319,7 @@ class ListController < ApplicationController
|
||||
if id.present?
|
||||
@category = Category.find_by_id(id)
|
||||
elsif slug_path.present?
|
||||
if (1..2).include?(slug_path.size)
|
||||
@category = Category.find_by_slug(*slug_path.reverse)
|
||||
end
|
||||
@category = Category.find_by_slug_path(slug_path)
|
||||
|
||||
# Legacy paths
|
||||
if @category.nil? && parts.last =~ /\A\d+-category/
|
||||
|
@ -359,9 +359,7 @@ class TagsController < ::ApplicationController
|
||||
if id.present?
|
||||
@filter_on_category = Category.find_by_id(id)
|
||||
elsif slug_path.present?
|
||||
if (1..2).include?(slug_path.size)
|
||||
@filter_on_category = Category.find_by_slug(*slug_path.reverse)
|
||||
end
|
||||
@filter_on_category = Category.find_by_slug_path(slug_path)
|
||||
|
||||
# Legacy paths
|
||||
if @filter_on_category.nil? && parts.last =~ /\A\d+-category/
|
||||
|
Reference in New Issue
Block a user