User tests: Successful: Unsuccessful:
Pull Request for Issue #46748
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:
scope_root parameter to CategoryeditField for filtering categories using nested set modellimit_category_scope option to Create Article menu item configurationFiles Modified:
Setup test environment:
Create menu item with scope limiting:
Test frontend article creation:
Test with scope limiting disabled:
Test permission interaction:
When creating articles via a "Create Article" menu item:
When creating articles via a "Create Article" menu item with "Limit Category Scope" enabled:
Backwards Compatibility:
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
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_categories Language & Strings Front End com_content |
| Labels |
Added:
Language Change
PR-6.1-dev
|
||
@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! 🙏
I have tested this item ✅ successfully on fdc5d30
I have tested this item ✅ successfully
Environment: Windows/XAMPP, Joomla 6.1-dev
Tests:
Result: Works as expected. Category scoping filters correctly using nested set model.
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 ✅
and what if someone wants to allow in two categories and not a third - thats not possible with this change