User tests: Successful: Unsuccessful:
Pull Request for Issue #45994 .
Add subform-order-changed event when order is changed in subform.
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.
Console is silent
In console a message like "fromPosition: 0, toPosition: 1"
Please select:
| Status | New | ⇒ | Pending |
| Category | ⇒ | JavaScript Repository NPM Change |
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!
| Title |
|
||||||
| Labels |
Added:
Feature
NPM Resource Changed
PBF
PR-6.1-dev
|
||
@Fedik We are sorry, couldn't test it. We applied PR and run npm ci, created custom HTML module with given content, inserted the code in administrator/templates/atum/index.php, reloaded backend page and moved the custom site module around in the list of site modules, but no console log. What could be missing?
the custom site module around in the list of site modules, but no console log. What could be missing?
Need to move the subform rows from the example 😉
Or any other subform, can also try create Custom field "subfrom" for article, and test it there.
I have tested this item ✅ successfully on 474b6b7
Tested with JBT
npm run build:jsadministrator/templates/atum/index.php in the beginning, after $wa is set| Status | Pending | ⇒ | Ready to Commit |
RTC
| Labels |
Added:
RTC
Removed: PBF |
||
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-01-24 10:15:18 |
| Closed_By | ⇒ | HLeithner |
There it is:
I will rebase to 6.1 when it will be in sync