Core has no form with a nested subform, so add one temporarily. Open modules/mod_custom/mod_custom.xml and add this field inside <fields name="params"> / <fieldset name="options">:
<field name="items" type="subform" label="Items" multiple="true">
<form>
<field name="name" type="text" label="Name" />
<field name="children" type="subform" label="Children" multiple="true" min="1" layout="joomla.form.field.subform.repeatable-table">
<form>
<field name="child" type="text" label="Child" />
</form>
</field>
</form>
</field>min="1".
6.2
After saving, the two rows are shown as entered: "Outer 1" with "Child 1" and "Outer 2" with "Child 2".
After saving there are three rows: "Outer 1" with an empty child, a row with an empty name and "Child 2", and "Outer 2" with an empty child. "Child 1" is lost.
In the browser inspector, before saving, the outer fields of the new rows have the name of their row, but the fields of the nested rows keep the X placeholder of the row template, in both rows:
jform[params][items][items0][name]
jform[params][items][itemsX][children][children0][child]
jform[params][items][items1][name]
jform[params][items][itemsX][children][children0][child]
The ids of the nested fields are duplicated across the rows for the same reason (jform_params__items__itemsX__children__children0__child in both rows).
So the nested values of all new rows are submitted under one key, itemsX. With two rows the second overwrites the first, and on save the data is stored as:
{
"items0": { "name": "Outer 1", "children": [] },
"itemsX": { "children": { "children0": { "child": "Child 2" } } },
"items1": { "name": "Outer 2", "children": [] }
}Joomla 6.2.0-rc3-dev (6.2-dev branch), PHP 8.3.35, MySQL 8.4.11, Apache 2.4.68, Chrome.
It only affects rows that the nested subform already has when the outer row is added, from min or from default values. Rows added to the nested subform afterwards with its own + button get the correct names.
| Labels |
Added:
No Code Attached Yet
bug
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-10-11 16:52:05 |
| Closed_By | ⇒ | Fedik |
It is known issue.
The reason is
min, ordeafultvaue.I am closing in favor of the existing issue.