Language Change PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar PranavAgarkar07
PranavAgarkar07
31 Jan 2026

Pull Request for Issue #46748

Summary of Changes

This PR implements a category visibility constraint feature that allows site administrators to limit the category dropdown in article editing forms to show only a specific category and its subcategories.

Changes:

  • Add scope_root parameter to CategoryeditField for filtering categories using nested set model
  • Update HtmlView to pass category scope from menu params to the article form
  • Add limit_category_scope option to Create Article menu item configuration
  • Add language strings for new parameter (en-GB)
  • Implements nested set filtering (lft/rgt) for efficient category dropdown filtering
  • Improves usability for sites with many categories

Files Modified:

  • administrator/components/com_categories/src/Field/CategoryeditField.php - Core filtering logic
  • components/com_content/src/View/Form/HtmlView.php - Pass scope parameter
  • components/com_content/tmpl/form/edit.xml - Menu item configuration
  • administrator/language/en-GB/com_content.ini - Language strings

Testing Instructions

  1. Setup test environment:

    • Create a category hierarchy: "Events" (parent) → "Day 1", "Day 2", "Day 3" (children)
    • Create other unrelated top-level categories (e.g., "News", "Blog")
  2. Create menu item with scope limiting:

    • Navigate to Menus → Main Menu → Add New Menu Item
    • Menu Item Type: Articles → Create Article
    • Set "Specific Category" to Yes
    • Choose "Events" category
    • Set "Limit Category Scope" to Yes (new option)
    • Save
  3. Test frontend article creation:

    • Navigate to the menu item on the frontend
    • Click to create a new article
    • Open the Category dropdown
    • Verify: Only "Events", "Day 1", "Day 2", "Day 3" appear
    • Verify: "News", "Blog" and other categories do NOT appear
  4. Test with scope limiting disabled:

    • Edit the same menu item
    • Set "Limit Category Scope" to No
    • Navigate to frontend and create article
    • Verify: All categories appear (default behavior)
  5. Test permission interaction:

    • Create a user with limited category permissions
    • Verify: Both permission filtering AND scope filtering apply (intersection)

Actual result BEFORE applying this Pull Request

When creating articles via a "Create Article" menu item:

  • The category dropdown shows ALL categories the user has permission to edit
  • On sites with hundreds of categories, this creates a very long, unwieldy dropdown
  • Users must scroll through many irrelevant categories to find the correct one
  • High risk of selecting the wrong category
  • Poor user experience for content editors

Expected result AFTER applying this Pull Request

When creating articles via a "Create Article" menu item with "Limit Category Scope" enabled:

  • The category dropdown shows ONLY the menu item's selected category and its subcategories
  • Significantly shorter, more manageable dropdown lists
  • Editors can quickly find and select the appropriate category
  • Reduced cognitive load and faster article creation
  • Improved user experience, especially for sites with large category hierarchies

Backwards Compatibility:

  • Feature is optional and defaults to disabled
  • Existing menu items are unaffected
  • No breaking changes

Link to documentations

Please select:

  • Documentation link for docs.joomla.org: (Documentation PR to be created after merge)

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org: (Manual PR to be created after merge)

  • No documentation changes for manual.joomla.org needed

avatar PranavAgarkar07 PranavAgarkar07 - open - 31 Jan 2026
avatar PranavAgarkar07 PranavAgarkar07 - change - 31 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jan 2026
Category Administration com_categories Language & Strings Front End com_content
avatar brianteeman
brianteeman - comment - 31 Jan 2026

and what if someone wants to allow in two categories and not a third - thats not possible with this change

avatar PranavAgarkar07 PranavAgarkar07 - change - 31 Jan 2026
Labels Added: Language Change PR-6.1-dev
avatar PranavAgarkar07
PranavAgarkar07 - comment - 31 Jan 2026

@brianteeman Updated! The implementation now supports selecting multiple categories.

Changed to modal_categories (multi-select) and added OR-based filtering logic. You can now select "Events" AND "News" but exclude "Blog" - exactly as you suggested.

Thanks for the feedback! 🙏

avatar Rajat-1804 Rajat-1804 - test_item - 31 Jan 2026 - Tested successfully
avatar Rajat-1804
Rajat-1804 - comment - 31 Jan 2026

I have tested this item ✅ successfully on fdc5d30

I have tested this item ✅ successfully

Environment: Windows/XAMPP, Joomla 6.1-dev

Tests:

  1. Created category hierarchy: Events → Day 1, Day 2, Day 3
  2. Created other categories: News, Blog
  3. Created menu item (Articles → Create Article)
  4. Set "Specific Category" to Events
  5. Set "Limit Category Scope" to Yes
  6. ✅ Frontend category dropdown shows ONLY Events and its subcategories
  7. ✅ News and Blog categories correctly hidden
  8. Tested with "Limit Category Scope" set to No
  9. ✅ All categories appear (default behavior works)

Result: Works as expected. Category scoping filters correctly using nested set model.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46804.

avatar PranavAgarkar07 PranavAgarkar07 - edited - 1 Feb 2026
avatar PranavAgarkar07 PranavAgarkar07 - edited - 1 Feb 2026
avatar PranavAgarkar07 PranavAgarkar07 - change - 1 Feb 2026
The description was changed
avatar PranavAgarkar07 PranavAgarkar07 - edited - 1 Feb 2026
avatar PranavAgarkar07 PranavAgarkar07 - change - 1 Feb 2026
The description was changed
avatar PranavAgarkar07 PranavAgarkar07 - edited - 1 Feb 2026
avatar PranavAgarkar07
PranavAgarkar07 - comment - 1 Feb 2026

Summary
This PR hardens the security of the multi-category scope filtering that got merged in #46748. Basically adds some safety checks and limits to prevent potential issues.

What Changed
Caps it at 50 categories max to avoid performance problems
Validates input format so bad data gets rejected early
Strips out duplicate IDs (why process the same category twice?)
Checks that nested set values actually make sense before using them
Better error handling - logs details for debugging but shows friendly messages to users
Added proper error messages instead of just failing silently
Why?
Right now there's no limit on how many category IDs you can pass in. Someone could theoretically pass thousands and slow things down. These changes add some guardrails without touching the core functionality.

Testing
Ran through a few scenarios:

Normal usage (2-3 categories): Works fine ✅
Stress test (tried 60 categories): Gets limited to 50 with a warning ✅
Bad input (random text): Shows clear error message ✅

Add a Comment

Login with GitHub to post a comment