mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Load subcategories through CategoryList (#26297)
When "lazy load categories" is enabled and parent_category_id was set, the query fetching categories contained a contradiction filtering both by parent_category_id and parent_category_id = NULL.
This commit is contained in:
@@ -140,7 +140,7 @@ class CategoryList
|
||||
|
||||
query = self.class.order_categories(query)
|
||||
|
||||
if @guardian.can_lazy_load_categories?
|
||||
if @guardian.can_lazy_load_categories? && @options[:parent_category_id].blank?
|
||||
page = [1, @options[:page].to_i].max
|
||||
query =
|
||||
query
|
||||
@@ -154,7 +154,7 @@ class CategoryList
|
||||
|
||||
@categories = query.to_a
|
||||
|
||||
if @guardian.can_lazy_load_categories?
|
||||
if @guardian.can_lazy_load_categories? && @options[:parent_category_id].blank?
|
||||
categories_with_rownum =
|
||||
Category
|
||||
.secured(@guardian)
|
||||
|
||||
Reference in New Issue
Block a user