Feature Test instructions missing PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar pashaarshad
pashaarshad
12 Jan 2026

Pull Request for Issue #46655 .

This adds support for an 'exclude' attribute in the category form field type, allowing developers to exclude specific category IDs from the list.

Usage:

This is useful for excluding categories like 'Uncategorized' from selection lists.

Pull Request for Issue # .

Summary of Changes

Testing Instructions

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar pashaarshad pashaarshad - open - 12 Jan 2026
avatar pashaarshad pashaarshad - change - 12 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jan 2026
Category Libraries
avatar richard67 richard67 - change - 12 Jan 2026
Title
Add exclude attribute to CategoryField (#46655)
[6.1] Add exclude attribute to CategoryField (#46655)
avatar richard67 richard67 - edited - 12 Jan 2026
avatar richard67
richard67 - comment - 12 Jan 2026

@pashaarshad Please provide testing instructions in the description of your PR. The head lines in our pull request template are not there for no reason.

avatar richard67 richard67 - change - 12 Jan 2026
The description was changed
avatar richard67 richard67 - edited - 12 Jan 2026
avatar neo314
neo314 - comment - 12 Jan 2026

I am new to this process. Am I supposed to offer documentation changes or anything else?

avatar richard67
richard67 - comment - 12 Jan 2026

I am new to this process. Am I supposed to offer documentation changes or anything else?

@neo314 No, as you only opened the issue you are not required to do anything. It's on the author of this pull request here to do that, if necessary. But it would be nice of course if you could test this PR.

avatar neo314
neo314 - comment - 12 Jan 2026

I tested the code I offered. Not sure what further I should do since there are no testing instructions. Not sure if what I offered got changed.

avatar richard67
richard67 - comment - 12 Jan 2026

Well this PR is indeed missing testing instructions. If they have been added you could follow these instructions, and if the test was successful submit your test result in the issue tracker. But as said, right now it is missing instructions.

avatar neo314
neo314 - comment - 12 Jan 2026

Thanks for the guidance.

avatar tecpromotion
tecpromotion - comment - 23 Jan 2026

@pashaarshad Please create test instructions for the testers.

avatar Denitz
Denitz - comment - 30 Jan 2026

@pashaarshad It's more logical to add support for filter.excluded filter in Joomla\CMS\HTML\Helpers\Category::options(), similar like we already have for e.g. state of Joomla\Component\Users\Administrator\Model\UsersModel.

Field will just pass attribute value to helper via $filters['filter.excluded']

It's a more solid approach.

avatar chaitali-tekdi chaitali-tekdi - test_item - 30 Jan 2026 - Tested successfully
avatar chaitali-tekdi
chaitali-tekdi - comment - 30 Jan 2026

I have tested this item ✅ successfully on 03a95fa

I tested this issue, and it was tested successfully.


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

avatar chaitali-tekdi chaitali-tekdi - test_item - 30 Jan 2026 - Tested successfully
avatar chaitali-tekdi
chaitali-tekdi - comment - 30 Jan 2026

I have tested this item ✅ successfully on 03a95fa

I tested this issue, and it was tested successfully.


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

avatar chaitali-tekdi chaitali-tekdi - test_item - 30 Jan 2026 - Tested successfully
avatar chaitali-tekdi
chaitali-tekdi - comment - 30 Jan 2026

I have tested this item ✅ successfully on 03a95fa

I tested this issue, and it was tested successfully.


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

avatar pashaarshad pashaarshad - edited - 30 Jan 2026
avatar pashaarshad pashaarshad - edited - 30 Jan 2026
avatar pashaarshad
pashaarshad - comment - 30 Jan 2026

Comment for PR #46668:

Hi everyone,

Sorry for the delayed response! I was out of station and had limited access to my development environment. I'm back now and have prepared the testing instructions as requested.

Summary of Changes
This PR adds support for an exclude attribute in the Category form field type (Joomla\CMS\Form\Field\CategoryField). This allows developers to exclude specific category IDs from the dropdown list.

Usage Example:

This is particularly useful for excluding categories like "Uncategorized" or system-reserved categories from user selection.

Testing Instructions
Prerequisites
A fresh Joomla installation with sample data, or create at least 3-4 categories in Content → Categories
Note down the IDs of the categories you want to test with (visible in the ID column of the category list)
Test Steps
Test 1: Basic Exclude Functionality

Go to article.xml
Find the catid field and add the exclude attribute with one or more category IDs:

<field
name="catid"
type="category"
extension="com_content"
exclude="2,4"
...
/>

Go to Content → Articles → New
Click on the Category dropdown
Expected Result: Categories with IDs 2 and 4 should NOT appear in the list
Test 2: Single Category Exclusion

Modify the field to exclude only one category: exclude="1"
Refresh the article form
Expected Result: Only the category with ID 1 is excluded
Test 3: No Exclude Attribute (Backward Compatibility)

Remove the exclude attribute entirely
Refresh the article form
Expected Result: All categories appear as normal (no regression)
Test 4: Empty Exclude Attribute

Set exclude=""
Refresh the article form
Expected Result: All categories appear (same as no attribute)
Test 5: Invalid Category IDs

Set exclude="99999" (non-existent ID)
Refresh the article form
Expected Result: No errors, all existing categories appear
Actual Result BEFORE Applying This Pull Request
The Category form field does not support excluding specific categories
Developers cannot filter out unwanted categories from selection dropdowns
Expected Result AFTER Applying This Pull Request
The exclude attribute is available for the Category form field
Specified category IDs are excluded from the dropdown options
Backward compatibility is maintained when the attribute is not used
Documentation
Documentation link for docs.joomla.org: Documentation update needed - The Category Form Field documentation should include the new exclude attribute
No documentation changes for manual.joomla.org needed

Thank you @richard67, @tecpromotion, and @Denitz for your patience and feedback!

@Denitz - Regarding your suggestion about filter.excluded in the Helper, that's a good point for a more architectural approach. However, this implementation keeps things simple and consistent with how other attributes work in form fields. Happy to discuss further if needed.

Should I push this comment to the PR? Also, do you want me to check if there's any actual code in the PR that needs to be reviewed for the implementation?

avatar joomdonation
joomdonation - comment - 31 Jan 2026

@pashaarshad You should follow suggestion from @Denitz

That would be better approach

avatar pashaarshad
pashaarshad - comment - 31 Jan 2026

Thanks @joomdonation and @Denitz for the suggestion!

I've updated the implementation:

Added filter.exclude support in Category::options() method following the same pattern as other filters
Updated CategoryField::getOptions() to pass exclude attribute via $filters['filter.exclude']
Please review!

avatar Denitz
Denitz - comment - 31 Jan 2026

No new code here.

avatar pashaarshad pashaarshad - change - 31 Jan 2026
Labels Added: Feature Test instructions missing PR-6.1-dev
avatar Denitz
Denitz - comment - 31 Jan 2026

Looks great now!

Add a Comment

Login with GitHub to post a comment