# משתמשים אינם מסוגלים לערוך את ניווט הקטגוריות מאז הוצגת הקטגוריות הטעונות חלקית

**URL:** <https://meta.discourse.org/t/users-are-not-able-to-edit-category-navigation-since-introduction-of-partial-loaded-categories/337854>\
**Category:** Bug\
**Tags:** fixed\
**Created:** [22 בנובמבר,‏ 2024,‏ 11:52pm UTC](https://meta.discourse.org/t/users-are-not-able-to-edit-category-navigation-since-introduction-of-partial-loaded-categories/337854 "2024-11-22T23:52:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)\
**Post date:** [22 בנובמבר,‏ 2024,‏ 11:52pm UTC](https://meta.discourse.org/t/users-are-not-able-to-edit-category-navigation-since-introduction-of-partial-loaded-categories/337854/1 "2024-11-22T23:52:35Z")

</div>

We have a lot of categories and only a small subset of them is visible for normal users.

Except for admins, subcategories are not shown to most users in the “Edit category navigation”-modal.

If I increase the number of included subcategories in `Category scope :limited_categories_matching` ([source](https://github.com/discourse/discourse/blob/d880db3b7b748901366d0c94f58dada9096f967f/app/models/category.rb#L395-L404)) from 5 to some number, which effectively disables partial loading, the missing categories are shown.

My conjecture is that unless coincidentally the subcategories visible to the user are among the first five subcategories, they will be removed from the result set by the permission check, resulting in the absence of a “load more” element in the editor.

I would be happy if the number of search results could be made configurable as a quick fix.

Side note: `categories-modal.gjs` assumes that there are more categories to load [if the number of shown categories is 5](https://github.com/discourse/discourse/blob/d880db3b7b748901366d0c94f58dada9096f967f/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs#L97), which also happens if there are exactly 5 categories to show, even if all subcategories are loaded using the patch above.

In the meantime, I use this template to fix this issue:

```plaintext
run:
  - replace:
      filename: "/var/www/discourse/app/models/category.rb"
      from: "select_descendants(Category.from(\"matches\").select(:matches, :id), 5"
      to: "select_descendants(Category.from(\"matches\").select(:matches, :id), 500"

```

---

_[View the full topic](https://meta.discourse.org/t/users-are-not-able-to-edit-category-navigation-since-introduction-of-partial-loaded-categories/337854)._
