No Code Attached Yet bug
avatar joomlaphp
joomlaphp
11 May 2022

Steps to reproduce the issue

Create new links from the menu and add sublinks. You know, you can change the order of the sub-links, but it does not change on the main page.

You can understand better with the video I added to my message.

Expected result

j413-menu.mp4

System information (as much as possible)

  • Joomla 4.1.3 (new installation)
  • PHP Version 8.0.18

systeminfo-2022-05-11T13_40_14+03_00.txt

avatar joomlaphp joomlaphp - open - 11 May 2022
avatar joomla-cms-bot joomla-cms-bot - change - 11 May 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 May 2022
avatar joomlaphp joomlaphp - change - 11 May 2022
The description was changed
avatar joomlaphp joomlaphp - edited - 11 May 2022
avatar joomlaphp joomlaphp - change - 11 May 2022
The description was changed
avatar joomlaphp joomlaphp - edited - 11 May 2022
avatar joomlaphp joomlaphp - change - 11 May 2022
The description was changed
avatar joomlaphp joomlaphp - edited - 11 May 2022
avatar joomlaphp joomlaphp - change - 11 May 2022
The description was changed
avatar joomlaphp joomlaphp - edited - 11 May 2022
avatar drmenzelit
drmenzelit - comment - 11 May 2022

Confirmed... the order of the submenus doesn't change in frontend and it switch back to the previous order in the backend, when you load the backend again..

avatar Quy Quy - change - 11 May 2022
Labels Added: bug
avatar Quy Quy - labeled - 11 May 2022
avatar brianteeman
brianteeman - comment - 11 May 2022

works in 4.1.2
fails in 4.1.3

avatar joomlaphp
joomlaphp - comment - 11 May 2022

works in 4.1.2 fails in 4.1.3
As you said, there is no problem in 4.1.2.

avatar joomdonation
joomdonation - comment - 11 May 2022

@dgrammatiko Look like it causes by your PR #36353 . From my quick look, we are passing more data for order[] variable than needed.

Before your PR, we only submit cid[] ad order[] from affected rows (within the same level) but after your PR, data from all hidden order[] are posted in the request and it causes this error.

One solution would be delete order[] (and maybe cid[]) from formData. That should solve this issue but I'm unsure if it would cause any side affect. Could you please take a look?

avatar dgrammatiko
dgrammatiko - comment - 11 May 2022

Just revert that PR. That PR was wrong but some devs were insisting. Also it hasn't properly tested. If it had it would never been merged. Multiplying the wrongs won't produce a right...

avatar HLeithner
HLeithner - comment - 11 May 2022

So what's different in the menu then in modules. maybe the tree structure? does it fail with categories too?

avatar dgrammatiko
dgrammatiko - comment - 11 May 2022

So what's different in the menu then in modules

The sorting has 2 modes: flat and nested. I guess nobody tested the nested thing. Anyways that PR WAS wrongly trying to satisfy requirements that the CMS will never encounter. There were 2 thumbs down, the one was from me, the author of the PR and there's some more context in the issue that pushed me to open that PR...

avatar roland-d
roland-d - comment - 11 May 2022

@dgrammatiko If your PR is so wrong, why not just close it instead of thumbs down? Besides that I wonder what was changed in 4.1.3 that causes to break it.

avatar brianteeman
brianteeman - comment - 11 May 2022

The sorting has 2 modes: flat and nested. I guess nobody tested the nested thing

modules is only flat hence the problem did not occur.

avatar dgrammatiko
dgrammatiko - comment - 11 May 2022

Besides that I wonder what was changed in 4.1.3 that causes to break it.

@joomdonation explained few posts above what caused the break

If your PR is so wrong, why not just close it instead of thumbs down?

I was asked not to close it, (there's more here but not for public consumption, the issue has some leads)

avatar richard67
richard67 - comment - 11 May 2022

Besides that I wonder what was changed in 4.1.3 that causes to break it.

@roland-d The PR was merged 19 days ago and so released with 4.1.3 and do not in 4.1.2 yet. So the PR was the breaking change, nothing else. It’s like @dgrammatiko said: The PR has not been tested with the nested option, possibly because the testing instructions did not include that.

avatar joomdonation joomdonation - change - 12 May 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-05-12 05:14:41
Closed_By joomdonation
avatar joomdonation joomdonation - close - 12 May 2022
avatar joomdonation
joomdonation - comment - 12 May 2022

PR #37781 should fix this issue, so I'm closing the issue. If anyone has this issue on your live site, please get this zip file, unzip it, upload received files to media/system/js folder on your site, then clear browser cache (press Ctrl + F5) and the issue will be sorted.
draggable.zip

avatar joomlaphp
joomlaphp - comment - 12 May 2022

@joomdonation
I did a fresh install and tried again, the problem persists for me.

j413.mp4
avatar joomdonation
joomdonation - comment - 12 May 2022

@joomlaphp After uploading the modified JS files, please make sure you clear browser cache (press Ctrl + F5) before checking it again. Maybe it is not working because your browser is still caching the old js files?

avatar retromore
retromore - comment - 20 May 2022

Sorry I commented on the closed related issue: #37786
I applied the provided patch with clean cache and there's a still a slight issue: drag the same item 3 times and and it will skip saving the third one. It's evident with both modules and menus.

modules-2.mp4

Add a Comment

Login with GitHub to post a comment