NPM Resource Changed bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar RiteshGite
RiteshGite
26 Apr 2026

Pull Request resolves #47675

  • 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

Fixed the isNested variable to properly handle data-nested="false" attribute by converting the string value to a boolean.

Testing Instructions

  1. Set data-nested="false" on a draggable table
  2. Try to drag and drop rows
  3. Verify that sorting works correctly
  4. Test with data-nested="true" to ensure nesting still works

Actual result BEFORE applying this Pull Request

When data-nested="false" is set, drag-and-drop sorting does not work because the string "false" is treated as truthy in JavaScript, causing the condition if (isNested) to incorrectly evaluate to true.

Expected result AFTER applying this Pull Request

Both data-nested="true" and data-nested="false" work correctly. The fix explicitly converts the dataset string value to a boolean using isNested = container.dataset.nested === 'true';

Link to documentations

avatar RiteshGite RiteshGite - open - 26 Apr 2026
avatar RiteshGite RiteshGite - change - 26 Apr 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Apr 2026
Category JavaScript Repository NPM Change
avatar BeginnerJoomlaCom
BeginnerJoomlaCom - comment - 26 Apr 2026

Please use the Pull Request-Template.

avatar RiteshGite RiteshGite - change - 26 Apr 2026
The description was changed
avatar RiteshGite RiteshGite - edited - 26 Apr 2026
avatar RiteshGite RiteshGite - change - 27 Apr 2026
Labels Added: NPM Resource Changed bug PR-5.4-dev
avatar muhme muhme - change - 8 May 2026
Title
Fix: Handle data-nested="false" correctly in draggable list #47675
[5.4] Fix sorting for data-nested="false" in draggable list #47675
avatar muhme muhme - edited - 8 May 2026
avatar krishnagandhicode
krishnagandhicode - comment - 8 May 2026

Thanks for your Contribution @RiteshGite.

Could you please give us more explained( a bit in detail) Testing Instruction to test this PR?

avatar joomdonation
joomdonation - comment - 8 May 2026

@RiteshGite Technically, your fix is correct. However, changing this behavior now could cause many views in Joomla core (such as Categories, Menu Items, Modules, etc.) to suddenly stop working as expected, because they currently use data-nested="false" in places where it should be data-nested="true".

A few examples:

https://github.com/joomla/joomla-cms/blob/5.4-dev/administrator/components/com_categories/tmpl/categories/default.php#L130
https://github.com/joomla/joomla-cms/blob/5.4-dev/administrator/components/com_menus/tmpl/items/default.php#L105

So at the moment, this JS bug actually allows buggy core code (and probably some third-party extensions as well) to continue working as expected :)

I think the safer approach would be:

  1. First identify and fix all existing code which has data-nested="false" by mistake (Modules, Categories....)
  2. Then change the JS behavior afterward, ideally in Joomla 7 (or possibly 6.2 I'm unsure).
avatar RiteshGite
RiteshGite - comment - 16 May 2026

Hi @joomdonation

Thanks for the guidance!

I've created PR #47780 which addresses the first step you mentioned.
This PR fixes the data-nested attributes in Categories and Menu Items
components that have parent-child hierarchies.

Once this PR is merged, the JavaScript fix in this PR (#47689) can be
safely applied without breaking any existing functionality.

The approach:

  1. PR #47780 - Fix data-nested attributes in core components ✓
  2. PR #47689 - Fix JavaScript boolean conversion (this PR)

Looking forward to your review!

avatar RiteshGite
RiteshGite - comment - 16 May 2026

Hi @krishnagandhicode

Thanks for the feedback!

I've added more detailed testing instructions in the related PR #47780, covering step-by-step testing for nested drag-and-drop behavior in Categories, Menu Items, and Modules.

Please let me know if you think more scenarios should be covered.

avatar joomdonation
joomdonation - comment - 17 May 2026

Hi @RiteshGite

Change on this PR is counted backward incompatible, so the earliest version we can make this change is Joomla 7. For the time being, I would suggest we fix wrong usages of data-nested in our core code (as you did in PR #47780), and worry about this later (I saw somewhere we might switch to use a different library for drag and drop in J7)

avatar RiteshGite
RiteshGite - comment - 17 May 2026

@joomdonation Understood.

We'll keep the core data-nested fixes in #47780 for now, and revisit the JS behavior change later if needed.

Add a Comment

Login with GitHub to post a comment