PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Shauryan0207
Shauryan0207
23 Dec 2025

Summary of Changes

Fixed OptionsRule validation to support groupedlist fields by iterating through <group> children to find nested options.

Testing Instructions

Create a groupedlist field with validate="options", submit with valid value, and verify validation passes.

Steps to Test

  1. Create a test plugin with a groupedlist field:
    • Go to System → Plugins → Create a test plugin XML file with this field definition:
<field
    name="test_grouped"
    type="groupedlist"
    label="Test Grouped Field"
    validate="options"
>
    <option value="">Select Option</option>
    <group label="Group 1">
        <option value="option1">Option 1</option>
        <option value="option2">Option 2</option>
    </group>
    <group label="Group 2">
        <option value="option3">Option 3</option>
        <option value="option4">Option 4</option>
    </group>
</field>
  1. Test the validation:

    • Open the plugin configuration
    • Select a valid option from any group (e.g., "Option 2" or "Option 3")
    • Click Save
  2. Verify the result:

    • BEFORE this PR: You would get "Invalid field: test_grouped" error
    • AFTER this PR: The field saves successfully without validation errors

Actual result BEFORE applying this Pull Request

Validation fails with "Invalid field" error even when selecting valid grouped options because OptionsRule only checked direct <option> children and ignored options nested inside <group> elements.

Expected result AFTER applying this Pull Request

Validation passes for valid options within any group. The rule now correctly iterates through both direct options and options nested within group elements.

Link to documentations

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar Shauryan0207 Shauryan0207 - open - 23 Dec 2025
avatar Shauryan0207 Shauryan0207 - change - 23 Dec 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Dec 2025
Category Libraries
avatar Shauryan0207 Shauryan0207 - change - 23 Dec 2025
The description was changed
avatar Shauryan0207 Shauryan0207 - edited - 23 Dec 2025
avatar Shauryan0207 Shauryan0207 - change - 23 Dec 2025
The description was changed
avatar Shauryan0207 Shauryan0207 - edited - 23 Dec 2025
avatar Shauryan0207 Shauryan0207 - change - 23 Dec 2025
Labels Added: PR-5.4-dev
avatar Fedik
Fedik - comment - 23 Dec 2025

This is new feature and should go to 6.1-dev.
The documentation update is needed.
Suggested changes not going to work reliable. Following will not be rendered properly:

<field
    name="test_grouped"
    type="groupedlist"
>
    <option value="">Select Option</option>
    <group label="Group 1">
        <option value="option1">Option 1</option>
        <option value="option2">Option 2</option>
    </group>
    <option value="v1">Foo</option>
    <group label="Group 2">
        <option value="option3">Option 3</option>
        <option value="option4">Option 4</option>
    </group>
    <option value="v2">Bar</option>
</field>
avatar Fedik
Fedik - comment - 23 Dec 2025

Ah no, ignore my comment, I mixed up with the Field, but this is only validation.

Sorry for confusion.

avatar Shauryan0207
Shauryan0207 - comment - 23 Dec 2025

Ah no, ignore my comment, I mixed up with the Field, but this is only validation.

Sorry for confusion.

No worries 😅

avatar richard67
richard67 - comment - 23 Dec 2025

@Fedik As you have labelled this PR as feature: Should it be rebased to 6.1-dev? Ah, I just see you've changed it to bug.

avatar exlemor
exlemor - comment - 24 Dec 2025

@Shauryan0207 Hi Shauryan, I tried to create a plugin but for those of us who are not coders, that's not so simple, I didn't succeed (I asked AI, it created me a simple plugin but when I used it to test your PR, I couldn't replicate the BEFORE condition so didn't work and I can't say I trust AI for this purpose) - so that I could gladly test your PR, can you add in the testing instructions a .zip file of the test plugin? (thanks)

avatar ceford ceford - test_item - 6 Jan 2026 - Tested successfully
avatar ceford
ceford - comment - 6 Jan 2026

I have tested this item ✅ successfully on 705dcaf


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

Add a Comment

Login with GitHub to post a comment