Skip to content

Conversation

HLeithner
Copy link
Member

If you create an subform for multiple rows and allow to order and save this subform as json, it is not possible to reorder entries.

There might be an alternative to fix this issue in the javascript. But that would not fix the postprocessing issue of subform child fields.

Summary of Changes

This PR changes the associative array result to an indexed array by walking recursive thru all subforms.

This behavior can be activated by adding the indexed="true"? attribute to the subform xml definition.
We use an extra attribute to b/c reasons, but would also expect that there should no problems changing this behavior for all subforms without a switch.

We can think about deprecating the old behavior.

Testing Instructions

  • create a component with a subform in the form xml
  • the subform needs to be multiple and saved as json in the table
  • try to reorder rows

Actual result BEFORE applying this Pull Request

  • does not change the order after save

Expected result AFTER applying this Pull Request

  • changes the order on save

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

@HLeithner HLeithner requested a review from laoneo as a code owner September 1, 2025 19:03
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.1-dev and removed Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester labels Sep 1, 2025
@HLeithner HLeithner force-pushed the 6.1/feature/order-subform branch from 67ae6f8 to 9fd4a92 Compare September 1, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants