NPM Resource Changed ? ? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
18 May 2021

Pull Request for Issue #33917

Summary of Changes

My attempt to fix drag and drop re-ordering issue #33917 . Ping everyone to review code, especial @dgrammatiko @Fedik @Ruud68 who understand the issue and discussed about it in #33917

Testing Instructions

  1. Download update package for this PR at https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/33937/downloads/43843/Joomla_4.0.0-beta8-dev+pr.33937-Development-Update_Package.zip , go to System ->Update -> Joomla, upload and install that updated package

  2. Go to Users -> Fields, create 7 or 8 user custom fields . (You just need to create 1 field, then use Save As Copy to create other fields to save time)

  3. Click on Sort icon to sort fields by ordering, try to drag and drop to change of the field. Then re-fresh the page and make sure the ordering is sorted.

  4. Choose 5 from Number records dropdown (so that the system will only display 5 records per page). Navigate to page 2 (that's the reason I asked you to create 7 or 8 fields). Then try to change ordering of items on that second page, refresh the page and make sure the ordering are kept (items ordering are saved properly)

Actual result BEFORE applying this Pull Request

  • ordering data of all items changed for each re-order action. Could cause performance issue
  • ordering data of items always re-started from 1, which cause wrong ordering value, especially when we re-order items from page 2, page 3....

Expected result AFTER applying this Pull Request

  • only ordering data of the necessary items are changed.
  • ordering data of items in next page (page 2, page 3...) are calculated base on it's existing ordering data and the item which is re-ordered in the action
avatar joomdonation joomdonation - open - 18 May 2021
avatar joomdonation joomdonation - change - 18 May 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2021
Category JavaScript Repository NPM Change
avatar Fedik
Fedik - comment - 18 May 2021

Looks good on quick look. Redo of j3 version?

Noticed you do not skip "mirror" element of dragula.js. You think it will not cause the same issue as was fixed before? in #33909
Btw, if do final calculation at "dragend" event then the "mirror" element will be already removed.

avatar joomdonation
joomdonation - comment - 18 May 2021

Looks good on quick look. Redo of j3 version?

Should work in the same way with J3 except that in J3, we submitted data of all records. This version, a bit improvement because we only submit data of the record needs to be updated only

Noticed you do not skip "mirror" element of dragula.js. You think it will not cause the same issue as was fixed before

Could not say that I understand how dragula works. But base on my debug, that mirror element is always the latest row when we do querySelectorAll, so it is OK me (tried some console.log to check the submit data, tested and it works well in my test)

avatar dgrammatiko
dgrammatiko - comment - 18 May 2021

Noticed you do not skip "mirror" element of dragula.js. You think it will not cause the same issue as was fixed before?

Probably not as the rows are container children and the mirror element is before the body end...

const rows = [].slice.call(container.querySelectorAll(orderSelector));

avatar joomdonation joomdonation - change - 18 May 2021
The description was changed
avatar joomdonation joomdonation - edited - 18 May 2021
avatar dgrammatiko dgrammatiko - test_item - 18 May 2021 - Not tested
avatar dgrammatiko dgrammatiko - test_item - 18 May 2021 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 18 May 2021

I have tested this item successfully on 6b4d90e

Categories are fine, articles not but there's an issue for this view: #33936


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

avatar joomdonation joomdonation - change - 18 May 2021
Labels Added: NPM Resource Changed ? ?
avatar joomdonation joomdonation - change - 18 May 2021
The description was changed
avatar joomdonation joomdonation - edited - 18 May 2021
avatar dgrammatiko dgrammatiko - test_item - 18 May 2021 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 18 May 2021

I have tested this item successfully on e61426b


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

avatar PhilETaylor
PhilETaylor - comment - 18 May 2021

Maybe one of these days the JSST @joomla/security team might actually acknowledge and reply to my email about a security issue related to this... 12 days and not even an acknowledgement or initial response.

edit: not "related" to the changes in this PR, but "generally related to reordering", sorry.

avatar dgrammatiko
dgrammatiko - comment - 18 May 2021

but "generally related to reordering", sorry.

Is it J4 specific? (or in plain English did I messed up big time?)

avatar PhilETaylor
PhilETaylor - comment - 18 May 2021

nothing to do with your work :) its in PHP :) - I've pinged them again today and @richard67 directly to see if I can get responses... its like a ghost town trying to contact the JSST

avatar dgrammatiko
dgrammatiko - comment - 18 May 2021

its in PHP :)

I think I spotted it, it's a 1 line fix if I got it right?

avatar PhilETaylor
PhilETaylor - comment - 18 May 2021

yes probably - but probably effects Joomla 3 also

avatar dgrammatiko
dgrammatiko - comment - 18 May 2021

yes probably - but probably effects Joomla 3 also

Confirmed

avatar joomdonation
joomdonation - comment - 19 May 2021

@PhilETaylor @dgrammatiko If I understand that issue right, maybe it is not really a security because we at least check edit state permission during saving ordering process already

And maybe we should do the fix for J4 only. If we do that fix in J3, it might make third party extensions broken for that task (because there could be extensions do not pass that data in save ajax ordering request in URL)

Just blind guess :D.

avatar PhilETaylor
PhilETaylor - comment - 19 May 2021

This is why we have a whole team dedicated, that should be addressing this themselves. Instead all of my emails have been ignored.

The current state of that team is undeterminable.

If my emails about this minor issue are ignored, what is to say that major issues reported by others are also being ignored by the projects JSST team

The ACL check, is no substitution for correct request Security.

avatar PhilETaylor
PhilETaylor - comment - 19 May 2021

And yes this should be fixed in 3, as well! Not fixing security issues because they might affect 3PD is simply unacceptable, And this project has always made the right decision previously to implement request Security correctly

avatar PhilETaylor
PhilETaylor - comment - 19 May 2021

And because of the nature of the security fix required, it has to be handled by the JSST team, who can then merge it by release lead just before releasing the next version of Joomla! 3

avatar PhilETaylor
PhilETaylor - comment - 19 May 2021

Finally got a reply from the team, they have confirmed the issue, and they are working on a fix for joomla 3.

Sorry to hijack this PR comment thread

avatar joomdonation
joomdonation - comment - 19 May 2021

Good to know that. And I was also wrong when assumed that the fix is backward incompatible. Actually, J3 is working in different way with J4 (the whole form data is serialized and submitted, so the fix is safe for J3, too)

avatar TLWebdesign TLWebdesign - test_item - 19 May 2021 - Tested successfully
avatar TLWebdesign
TLWebdesign - comment - 19 May 2021

I have tested this item successfully on e61426b


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

avatar richard67 richard67 - change - 19 May 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 19 May 2021

RTC


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

avatar wilsonge wilsonge - change - 19 May 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-05-19 22:28:47
Closed_By wilsonge
Labels Added: ? ?
Removed: ?
avatar wilsonge wilsonge - close - 19 May 2021
avatar wilsonge wilsonge - merge - 19 May 2021
avatar wilsonge
wilsonge - comment - 19 May 2021

Thanks! Good work!

Add a Comment

Login with GitHub to post a comment