RTC NPM Resource Changed bug PR-5.1-dev Pending

User tests: Successful: Unsuccessful:

Pull Request for Issue #43800.

Summary of Changes

Updated subform JavaScript behaviours to look for .switcher when .radio is not found.

Testing Instructions

  1. Add the following subform to a form:
<field
    name="switcher_test_subform"
    type="subform"
    label="Switcher Test"
    multiple="true"
    layout="joomla.form.field.subform.repeatable">
    <form>
        <fieldset>
            <field
                name="switcher_test"
                type="radio"
                label="Switcher Test"
                layout="joomla.form.field.radio.switcher"
                default="0"
                >
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
        </fieldset>
    </form>
</field>
  1. Access the form and click + to add a subform item.

Actual result BEFORE applying this Pull Request

A subform item is created and added to the subform, but the following JavaScript error occurs, which interferes with any other JavaScript attempting to run.

TypeError: Cannot read properties of null (reading 'nodeName')
    at joomla-field-subform.js?25ff4b:305:31
    at Array.forEach (<anonymous>)
    at JoomlaFieldSubform.fixUniqueAttributes (joomla-field-subform.js?25ff4b:263:14)
    at JoomlaFieldSubform.addRow (joomla-field-subform.js?25ff4b:195:10)
    at JoomlaFieldSubform.<anonymous> (joomla-field-subform.js?25ff4b:95:16)

(Error trace taken with debug mode enabled.)

Expected result AFTER applying this Pull Request

A subform item is created and added to the subform without any JavaScript errors occurring.

Link to documentations

No documentation changes for docs.joomla.org needed.
No documentation changes for manual.joomla.org needed.

avatar mattelkins-bluefrontier mattelkins-bluefrontier - open - 18 Jul 2024
avatar mattelkins-bluefrontier mattelkins-bluefrontier - change - 18 Jul 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Jul 2024
Category Layout
avatar Fedik
Fedik - comment - 18 Jul 2024

There need to fix JS.
Adding this class can break some styling for templates that have some css for .radio

avatar mattelkins-bluefrontier mattelkins-bluefrontier - change - 18 Jul 2024
Labels Added: bug PR-5.1-dev
avatar joomla-cms-bot joomla-cms-bot - change - 18 Jul 2024
Category Layout JavaScript Repository NPM Change
avatar mattelkins-bluefrontier mattelkins-bluefrontier - change - 18 Jul 2024
The description was changed
avatar mattelkins-bluefrontier mattelkins-bluefrontier - edited - 18 Jul 2024
avatar mattelkins-bluefrontier
mattelkins-bluefrontier - comment - 18 Jul 2024

Many thanks for your feedback, @Fedik. Updated.

avatar Fedik
Fedik - comment - 18 Jul 2024

Thanks, yes that will work.
However I think it still not very reliable solution, when markup/class will changes at some point.
What we need: is to pick closest fieldset, that direct parent of the radio/checkbox inputs (fieldset>input or fieldset>div>input), but ignore any other parent fieldsets.

hmhm, I will look later, in detail.

avatar mattelkins-bluefrontier mattelkins-bluefrontier - change - 18 Jul 2024
Labels Added: NPM Resource Changed
avatar Fedik Fedik - test_item - 18 Jul 2024 - Tested successfully
avatar Fedik
Fedik - comment - 18 Jul 2024

I have tested this item ✅ successfully on c2802cf


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

avatar viocassel viocassel - test_item - 21 Jul 2024 - Tested successfully
avatar viocassel
viocassel - comment - 21 Jul 2024

I have tested this item ✅ successfully on c2802cf


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

avatar Quy Quy - change - 21 Jul 2024
Status Pending Ready to Commit
avatar Quy
Quy - comment - 21 Jul 2024

RTC


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

avatar Quy Quy - change - 26 Jul 2024
Labels Added: RTC
avatar bembelimen bembelimen - change - 10 Aug 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-08-10 09:41:31
Closed_By bembelimen
avatar bembelimen bembelimen - close - 10 Aug 2024
avatar bembelimen bembelimen - merge - 10 Aug 2024
avatar bembelimen
bembelimen - comment - 10 Aug 2024

Thx

Add a Comment

Login with GitHub to post a comment