PR-5.1-dev Pending

User tests: Successful: Unsuccessful:

avatar artur-stepien
artur-stepien
6 Aug 2024

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

avatar artur-stepien artur-stepien - open - 6 Aug 2024
avatar artur-stepien artur-stepien - change - 6 Aug 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Aug 2024
Category Layout
avatar richard67
richard67 - comment - 6 Aug 2024

@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?

avatar Fedik
Fedik - comment - 6 Aug 2024

We already have the fix #43804
Thanks.

avatar artur-stepien
artur-stepien - comment - 6 Aug 2024

@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.

avatar artur-stepien artur-stepien - close - 6 Aug 2024
avatar artur-stepien artur-stepien - change - 6 Aug 2024
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2024-08-06 09:47:03
Closed_By artur-stepien
Labels Added: PR-5.1-dev
avatar richard67
richard67 - comment - 6 Aug 2024

@artur-stepien Thanks for checking.

Add a Comment

Login with GitHub to post a comment