Skip to content

Conversation

@artur-stepien
Copy link
Contributor

Change made last month in a subform field broke subform support when there is a joomla.form.field.radio.switcher (and most likely joomla.form.field.radio.buttons) layout set on the field. The result is Uncaught TypeError like this
obraz
In short, the script is looking for a radio class in element parents. Where the script itself works fine, the switcher and buttons layout for the radio field lacks the radio class on a fieldset.

Summary of Changes

Added radio class to joomla.form.field.radio.switcher and joomla.form.field.radio.buttons layouts.

Testing Instructions

Add this field XML to any of the core modules like (eg mod_banners) and try to add new row in this field:

<field name="fields" type="subform"
       multiple="true"
       label="Fields"
>
    <form>
        <field name="checkboxes" 
               type="checkboxes" 
               label="Checkboxes"
        >
            <option value="0">JNO</option>
            <option value="1">JYES</option>
        </field>
        <field name="radio" 
               type="radio"
               label="Radio"
               layout="joomla.form.field.radio.switcher"
        >
            <option value="0">JNO</option>
            <option value="1">JYES</option>
        </field>
    </form>
</field>

Actual result BEFORE applying this Pull Request

Uncaught TypeError: can't access property "nodeName", b is null

Expected result AFTER applying this Pull Request

New row in a subform is added

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

@richard67
Copy link
Member

@artur-stepien Is it the same issue as reported with issue #43800 ? If so, there is a PR already: #43804 . To me it seems to be the same issue but that PR and yours here solve it in different ways. Could you check the other PR?

@Fedik
Copy link
Member

Fedik commented Aug 6, 2024

We already have the fix #43804
Thanks.

@artur-stepien
Copy link
Contributor Author

@Fedik @richard67 #43804 Will fix it too so no need to waste time on testing. Was searching for the ticket before creating PR but could not find it.

@richard67
Copy link
Member

@artur-stepien Thanks for checking.

@artur-stepien artur-stepien deleted the patch-4 branch August 21, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants