-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[5.4] Fix OptionsRule validation to support groupedlist fields #46608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.4] Fix OptionsRule validation to support groupedlist fields #46608
Conversation
a1f3907 to
716cbed
Compare
716cbed to
705dcaf
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Ah no, ignore my comment, I mixed up with the Field, but this is only validation. Sorry for confusion. |
No worries 😅 |
|
@Fedik |
|
@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) |
|
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. |
1 similar comment
|
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. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46608. |
|
System test failure is not related to this PR. |
|
✅ Final test before merge with JBT
|
|
Thank you @Shauryan0207 for your contribution. Thank you @richard67 and @heelc29 for supporting this PR. Thank you @ceford and @heelc29 for testing. @exlemor, plg_system_groupedlisttest.zip has now been added. It's a bit late, but thank you for trying. |
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
Test the validation:
Verify the result:
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