No Code Attached Yet bug
avatar AndySDH
AndySDH
18 Sep 2023

Steps to reproduce the issue

Preparing Child Fields

  • Go to Content -> Fields
  • Make sure you already have some custom fields created, one of these should be of type 'List', with a few options under "List Values"

Preparing Subform

  • Create a new Subform field. Under "Fields" add any field you want, one of these should be the List field you created earlier.
  • When creating the Subform field, go to the Options tab, and under the Form Options, set the Layout to 'Form'.

Replicating the issue

  • Create a new article or edit an existing article.
  • Edit the subform field in the article and add a few subform rows (even a couple is fine)
  • Make sure to fill in the list child field for each row
  • Now try to drag & drop a row up or down to re-order the rows

Expected result

You'd expect that all values in the child fields retain their value when re-ordering the rows.

Actual result

The values of the List child field get deleted upon re-ordering.

Here is a quick video showing the issue:
https://drive.google.com/file/d/1cr1LJejZSCsmXuzXw_vPe-HguPx9iZ6G/view?usp=sharing

System information (as much as possible)

Joomla 4.3.4

Additional comments

  • This is not an issue when the Subform uses the 'Table' layout. This issue only happens when using the 'Form' layout.
  • NB: The 'Form' layout can either be chosen manually in the Form Options, or it kicks in automatically when there are more than 4 sub fields.
avatar AndySDH AndySDH - open - 18 Sep 2023
avatar joomla-cms-bot joomla-cms-bot - change - 18 Sep 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Sep 2023
avatar AndySDH AndySDH - change - 18 Sep 2023
The description was changed
avatar AndySDH AndySDH - edited - 18 Sep 2023
avatar Fedik
Fedik - comment - 18 Sep 2023

Does it lossing the value in the form that already saved, or only for newly selected but not saved?

avatar Fedik
Fedik - comment - 18 Sep 2023

Hm, no, only for unsaved.
It something related to Choices re-init, while changing location in DOM
https://github.com/joomla/joomla-cms/blob/4.3-dev/build/media_source/system/js/fields/joomla-field-fancy-select.w-c.es6.js

Can use following, to reproduce:

<field type="subform" name="subform" label="subform" multiple="true">
  <form>
    <field type="list" name="list" label="list" layout="joomla.form.field.list-fancy-select">
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
    </field>
  </form>
</field>
avatar Fedik Fedik - change - 18 Sep 2023
Labels Added: bug
avatar Fedik Fedik - labeled - 18 Sep 2023
avatar tkuschel
tkuschel - comment - 11 Nov 2023

Which database and version is in use? I have another problem with tables consisting of field 'ordering' which is buggy since update mariadb 10.11.4 to 11.1.2 Perhaps there is a correlation.


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

avatar AndySDH
AndySDH - comment - 11 Nov 2023

No, there is no correlation to databases at all here. This is a javascript issue.

avatar Fedik Fedik - change - 11 Nov 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-11-11 13:23:21
Closed_By Fedik
avatar Fedik Fedik - close - 11 Nov 2023
avatar Fedik
Fedik - comment - 11 Nov 2023

Please test #42332

Add a Comment

Login with GitHub to post a comment