Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
13 Sep 2025

Pull Request for Issue #45994 .

Summary of Changes

Add subform-order-changed event when order is changed in subform.

Testing Instructions

Apply patch.
Run npm install.
Add subform somewhere, example in Custom HTML module parameters:

<field type="subform" name="subform" label="Subform" multiple="true">
  <form>
    <field type="text" name="text" label="Text"/>
  </form>
</field>

Add in to index.php of Atum template:

$wa->addInlineScript('
 document.addEventListener("subform-order-changed", function(event) {
    console.log("fromPosition: " + event.detail.fromPosition, "toPosition: " + event.detail.toPosition);
 });
', [], ['type' => 'module']);

Open the form with sbform, open browser console.
Try sort the rows in subform, and check console output.

Actual result BEFORE applying this Pull Request

Console is silent

Expected result AFTER applying this Pull Request

In console a message like "fromPosition: 0, toPosition: 1"

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: TBD
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 13 Sep 2025
avatar Fedik Fedik - change - 13 Sep 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Sep 2025
Category JavaScript Repository NPM Change
avatar Fedik
Fedik - comment - 13 Sep 2025

I will rebase to 6.1 when it will be in sync

avatar ceford ceford - test_item - 17 Sep 2025 - Tested successfully
avatar ceford
ceford - comment - 17 Sep 2025

I have tested this item ✅ successfully on 08a3f52

I found the instructions difficult. As this is a single JavaScript file change the rebuild should be npm run build:js. I used a new instance of Modules: Articles to test as there are already two subforms there. I created two instances of the Test text and moved them up/down. In the Console I needed to select the Logs item to see the message (I am not too familiar with the Console). Got there in the end!


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

Add a Comment

Login with GitHub to post a comment