? ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
14 Nov 2020

Pull Request for Issue #31331 .

Summary of Changes

This fixes subform value filtering when it have a default value.
Because a default value is a JSON string Form::filterField() produce:

Warning: Invalid argument supplied for foreach() in <root>/libraries/src/Form/Form.php on line 1572

Testing Instructions

Add subform field in to any xml in params section, example mod_custom.xml

<field name="subform_test2" type="subform" label="Subform field"
  multiple="true"
  default='[{"child_field": "Default text field value"}]'
>
    <form>
        <field
            name="child_field"
            type="text"
            label="Text field"
        />
    </form>
</field>

Open the form, remove all subform rows, and save.

Actual result BEFORE applying this Pull Request

Subform field is empty, with zero rows

Expected result AFTER applying this Pull Request

Subform field should show 1 row of default value

Documentation Changes Required

none

avatar Fedik Fedik - open - 14 Nov 2020
avatar Fedik Fedik - change - 14 Nov 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Nov 2020
Category Libraries
avatar ashvini77 ashvini77 - test_item - 5 Dec 2020 - Tested successfully
avatar ashvini77
ashvini77 - comment - 5 Dec 2020

I have tested this item successfully on d375042


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

avatar gostn gostn - test_item - 5 Dec 2020 - Tested successfully
avatar gostn
gostn - comment - 5 Dec 2020

I have tested this item successfully on d375042


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

avatar richard67 richard67 - change - 5 Dec 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 5 Dec 2020

RTC


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

avatar richard67 richard67 - change - 5 Dec 2020
Labels Added: ? ?
avatar HLeithner HLeithner - change - 29 Dec 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-12-29 08:05:27
Closed_By HLeithner
Labels
avatar HLeithner HLeithner - close - 29 Dec 2020
avatar HLeithner HLeithner - merge - 29 Dec 2020
avatar HLeithner
HLeithner - comment - 29 Dec 2020

Thanks

Add a Comment

Login with GitHub to post a comment