A recent change to the reference counting in the javascript controlling subforms causes J3.9.15 to not properly save nested subforms. A form rendered from saved data shows blank fields as the data can not properly be read. Rendered subforms with data saved under J3.9.14 is incorrectly displayed.
###Steps to reproduce:
Install Joomla 3.9.14
Modify the file j3914/plugins/actionlog/joomla/joomla.xml to include the following configuration fields:
<config>
<fields name="params">
<fieldset name="basic">
<field name="items"
type="subform"
label="Items"
multiple="true"
>
<form name="itemform">
<field name="itemtext"
type="text"
label="Item Text"
/>
<field name="subitems"
type="subform"
label="Subitems"
multiple="true"
>
<form name="subitemform">
<field name="subitemtext"
type="text"
label="Subitem Text"
/>
</form>
</field>
</form>
</field>
</fieldset>
</fields>
</config>
Set the fields in the plugin config page to something like this:
Items
Item text -> Textvalue
Subitems ->
Subitem Text -> subitemtextvalue
Save the configuration.
From your debugger, see that the POSTed data looks like this:
jform
params
items
items0
itemtext = "Textvalue"
subitems
subitems0
subitemtext = "subitemtextvalue"
From phpmyadmin, see that the saved params json data looks like this:
{"items":{"items0":{"itemtext":"Textvalue","subitems":{"subitems0":{"subitemtext":"subitemtextvalue"}}}}}
Compare this to J3.9.15:
Install Joomla 3.9.15
Modify the file j3915/plugins/actionlog/joomla/joomla.xml to include the following configuration fields, same as 3.9.14.
<config>
<fields name="params">
<fieldset name="basic">
<field name="items"
type="subform"
label="Items"
multiple="true"
>
<form name="itemform">
<field name="itemtext"
type="text"
label="Item Text"
/>
<field name="subitems"
type="subform"
label="Subitems"
multiple="true"
>
<form name="subitemform">
<field name="subitemtext"
type="text"
label="Subitem Text"
/>
</form>
</field>
</form>
</field>
</fieldset>
</fields>
</config>
Set the fields in the plugin config page to something like this, same as 3.9.14.
Items
Item text -> Textvalue
Subitems ->
Subitem Text -> subitemtextvalue
Save the configuration.
From your debugger, see that the POSTed data looks like this, different from 3.9.14:
jform
params
items
items0
itemtext = "Textvalue"
subitems = ""
items1
subitems
subitems0
subitemtext = "subitemtextvalue"
From phpmyadmin, see that the J3.9.15 saved params json data looks like this, different from 3.9.14:
{"items":{"items0":{"itemtext":"Textvalue","subitems":[]},"items1":{"subitems":{"subitems0":{"subitemtext":"subitemtextvalue"}}}}}
For comparison, the J3.9.14 params data was:
{"items":{"items0":{"itemtext":"Textvalue","subitems":{"subitems0":{"subitemtext":"subitemtextvalue"}}}}}
Labels |
Added:
?
|
Replacing subform-repeatable.js and subform-repeatable-uncompressed.js in J3.9.15 with the copies from J3.9.14 resolves the issue.
Replacing subform-repeatable.js and subform-repeatable-uncompressed.js in J3.9.15 with the copies from J3.9.14 resolves the issue.
it not resolve the issue, it replaces one bug to another
yeah, there a problem in the calculation of a names for a nested inputs
need time to investigate, it will be not soon
I can try, but cannot promise
Status | New | ⇒ | Confirmed |
I really appreciate your efforts. I have two sites I will keep patched manually for the time being. I tried to come up with a workaround in php in the onContentNormaliseRequestData event but it seems like such a hack, and requires a lot of input array manipulation. If there's anything I can do to help please let me know.
@gaelicwinter Untill it will be fixed you can use next workaround:
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-29 15:16:02 |
Closed_By | ⇒ | richard67 |
After save on J3.9.14

After save on J3.9.15
