Closed (duplicate)
Project:
Menuperformance
Version:
7.x-1.0-beta3
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2012 at 19:55 UTC
Updated:
7 Jan 2013 at 14:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
wroxbox commentedAnd here is the patch.
Comment #2
firebird commentedHi, and thanks for your contribution. I've just actually fixed this in a slightly different, and a lot simpler way. What I've done is I just added a few orderby-clauses to the query that gets the menu links:
The for-loop has been copied from Drupal's menu.inc. That's the way the links are originally ordered, so I'm hoping it'll work as it should.
This has now been committed to the latest version in git, please test that and let me know if there are any problems.
Comment #3
wroxbox commentedThank you @firebird
Imho that is still missing the client side ordering for items in select lists?
Comment #4
firebird commentedYes, I didn't quite get where that would be needed. What kind of use case do you have in mind where the items would need to be sorted in the client?
Comment #5
wroxbox commentedIn the widget "Provide a menu link" (node/add/edit form) those select option values are ordered alphabetically.
My patch was also ordering them to reflect the same ordering that menu structure has.
removed
changed
So I need that weight info into javascript and convert it to sortable object with the weight info.
Comment #6
firebird commentedI still don't get it. That's exactly what I fixed. The menu items are now ordered based on the menu structure order when creating or editing nodes. If the sorting is done on the server side, I don't see why we'd need to sort them again on the client side.
I've created a test menu that looks like this:
-P1
--C1
-P2
-AP3
In the /node/add form, the menu items are now correctly ordered (P1, P2, AP3) when using the latest version from git. When using the latest stable version (7.x-1.0-beta3), the links are indeed incorrectly ordered. If you have steps to reproduce the incorrect ordering from a clean install and using the latest dev version, please post them here.
Comment #7
wroxbox commentedCorrect. You were right. Tested it more carefully.
I mark this as duplicate for http://drupal.org/node/1841226 and close.