Language Change NPM Resource Changed PR-6.3-dev Pending

User tests: Successful: Unsuccessful:

avatar TLWebdesign
TLWebdesign
1 Oct 2026

Pull Request resolves # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Adds an optional Copy button to the rows of a repeatable subform. It inserts a new row below the row it belongs to, with the values of that row.

  • SubformField: new copy value for the buttons attribute, for example buttons="add,copy,remove,move". Off by default.
  • Subform layouts (form, grid, table and their by-fieldsets variants): the copy button and the button-copy attribute.
  • joomla-field-subform: copyRow(). The values are set on the new row before it is inserted, so fields that initialise when they are added to the page (fancy select, editor, calendar, showon) start with the copied values.
  • Fields - Subform plugin: new "Copy Rows" option, off by default.
  • Atum and Cassiopeia: position of the button in the form and grid layouts.
  • New language strings JGLOBAL_FIELD_COPY and PLG_FIELDS_SUBFORM_PARAMS_COPY_ROWS_LABEL.

Notes for review:

  • The subform script now imports JoomlaEditor from editor-api to read the current content of an editor, and the webcomponent.field-subform asset depends on editor-api.
  • File inputs are not copied.
  • The rows of a subform nested inside the copied row are not copied, the new row gets the default rows of the nested subform.

Testing Instructions

The PR changes JavaScript and SCSS. Use the prebuilt package of this PR, or apply it and run npm ci.

Custom fields

  1. Content → Fields → New, create a few fields with "Only Use In Subform" set to Yes, for example Text, List, Radio, Checkboxes, Calendar and Media.
  2. Create a field of type Subform, add the fields from step 1 and set "Copy Rows" to Yes.
  3. Create a second Subform field and leave "Copy Rows" on No.
  4. Edit an article, open the Fields tab, add a row to the first subform and fill in all fields.
  5. Click the Copy button of the row.
  6. Change a value in the copy and save the article.
  7. In the field from step 2 try the other Form Layouts (Form, Form Grid, Table) and repeat steps 4 and 5.

Form API

Add buttons="add,copy,remove,move" to a repeatable subform in any form XML, for example:

<field name="rows" type="subform" label="Rows" multiple="true" max="3"
    layout="joomla.form.field.subform.repeatable-table" buttons="add,copy,remove,move">
    <form>
        <field name="title" type="text" label="Title" />
        <field name="tags" type="tag" label="Tags" mode="ajax" multiple="true" />
        <field name="text" type="editor" label="Text" filter="safehtml" />
        <field name="user" type="user" label="User" />
    </form>
</field>

Check that the copy has the same values, that a newly typed tag and the editor content are copied, that the button does nothing when the maximum number of rows is reached, and that the button works with the keyboard (Tab to the button, Space or Enter).

Also check a language with RTL direction: in the form and grid layouts the button sits next to the Add button.

Actual result BEFORE applying this Pull Request

A subform row can only be added empty. There is no "Copy Rows" option in the Subform field.

Expected result AFTER applying this Pull Request

  • The subform with "Copy Rows" set to Yes (or copy in buttons) shows a Copy button in each row.
  • The button adds a new row directly below, with the same values. Both rows are saved.
  • Subforms without the option look and work as before.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar TLWebdesign TLWebdesign - open - 1 Oct 2026
avatar TLWebdesign TLWebdesign - change - 1 Oct 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2026
Category ⇒ Administration Language & Strings Layout Libraries NPM Change JavaScript Front End Plugins
avatar Fedik
Fedik - comment - 2 Oct 2026

Thanks for a try.

The subform script now imports JoomlaEditor

I am sorry, this is not acceptable.

The feature should work independend from the form fields like it does currently when User push "Add row".
We need to look how we can extend our API to make it work properly without such hacking.

The rows of a subform nested inside the copied row are not copied

This will get an issue reaport very quickly ;)

It is better no feature than half working feature ;)

avatar TLWebdesign
TLWebdesign - comment - 3 Oct 2026

Thanks a lot for your feedback! Back to the drawing board. i've investigated alternative solutions.

I looked into two ways:

option 1: Before reading the source row, the subform dispatches one generic event on it, alongside the joomla:updated and joomla:removed events it already sends. Fields that keep state outside their controls write it back when they receive it. TinyMCE and CodeMirror each get a small listener next to their existing joomla:updated handling.

option 2: No new event; the editors keep their textarea up to date themselves (save on blur or change).

My guess is the calendar data-alt-value trick is also unwanted 😅. So i was thinking to change it so when it initialises with a value but no alt value, it should parse the value. The calendars own change handler already does it like this from what i understand.

I'll put this PR to draft until we figure out the best way forward.

avatar TLWebdesign TLWebdesign - change - 3 Oct 2026
Title
…
[6.3] [AI] Copy subform row button
[6.3][DRAFT][AI] Copy subform row button
avatar TLWebdesign TLWebdesign - edited - 3 Oct 2026
avatar TLWebdesign TLWebdesign - change - 3 Oct 2026
Labels Added: Language Change NPM Resource Changed PR-6.3-dev
avatar TLWebdesign
TLWebdesign - comment - 3 Oct 2026

Hmm i think it is better to do one event for the whole row that will cover all fields:

Option 1, refined: instead of an event that only asks the source row to write its state back, the subform could fire one event per copied row, like subform-row-add, with the source row, the new row and the matched controls (source control and its counterpart in the new row) in the detail. Every field that keeps state outside its controls can then carry it over itself: the editors put their current content into the new textarea, and the calendar copies its data-alt-value. The subform stays unaware of field types, and third party fields can use the same event.

That would replace my calendar idea above. Parsing the value loses whatever the display format hides, for example the time of a date that is shown without it.

You like this better or do you have other idea's on how it should be implemented?

avatar Fedik
Fedik - comment - 4 Oct 2026

Hmhm, need to think. Cannot say currently.

avatar Fedik
Fedik - comment - 4 Oct 2026

Hmhm, need to hink. Cannot say currently.

Add a Comment

Login with GitHub to post a comment