The "Main navigation" superfish block is ignoring the menu weights of its list item's children. I have recreated this menu a couple of times, and no matter what I do it only displays menu items in the same order that the menu links were created. When I rearrange the list items in 'edit main navigation' this has no effect, I save the rearranged menu but when I go back to the site, the child items are stuck in their previous order.

I have not yet tried uninstalling and reinstalling superfish, but since nothing else is solving this issue, I think that's all I can do at this point.

Comments

lukejoliat created an issue. See original summary.

mermentau’s picture

There are changes since 8.x-1.0-rc2. It worked for me with the latest dev. I did notice that the changes in /admin/structure/menu/manage/main seemed a little quirky, but that would be in the core menu module I believe.

slipstreamer’s picture

The issue is also occurring to me in the first drop down of the menu only.

SuzeQ’s picture

I'm having the same issue. I'm running 8.x-1.0-rc2+5-dev.

breadcrumbs’s picture

See this issue https://www.drupal.org/node/2123317#comment-10709030
You can get the code from the git repo if you want a quick fix

marco.b’s picture

See this issue https://www.drupal.org/node/2123317#comment-10709030
You can get the code from the git repo if you want a quick fix

Sorry, I can't see, in which commit/version is the solution on the git repo.
please help.

breadcrumbs’s picture

This is what you need: http://cgit.drupalcode.org/superfish/commit/?id=66813d13603eae9294ca3aff...
Just add the usort function and it should work

marco.b’s picture

thx, that works fine for me.

marco.b’s picture

Status: Active » Closed (fixed)
levmyshkin’s picture

I think we need to use manipulators to order menu children. Manipulators are already used to order whole superfish menu before expandAll() method.

Patch with usort() doesn't check permissions without manipulators. So anonymous users can see all links in submenu including links to admin pages.

levmyshkin’s picture

Status: Closed (fixed) » Needs review

Just add link to /admin/content page or another admin page and see it under anonymous user. It will be displayed without any checking access.

Anonymous’s picture

Patched Superfish with the fix from #10 and it works for me.

ToxaViking’s picture

#7 works for me

caspervoogt’s picture

couldn't get #10 to apply, but #7 worked

levmyshkin’s picture

Did you try to apply on dev version of the module? Only dev version contains #7 patch, I removed it in #10 patch.

caspervoogt’s picture

yeah, I was using dev.. I try not to apply patches to non-dev releases

levmyshkin’s picture

It's strange because:
git clone --branch 8.x-1.x https://git.drupal.org/project/superfish.git
contains #5 patch

But 8.x-dev version from the module page doesn't contain #5 patch.

If you clone git version, you can apply patch #10.
For version 8.x-dev from the module page try to use a patch from the comment.

awasson’s picture

Yes, I believe this was patched back in Jan/Feb but it never made it to the published distributions.

Carlos Miranda Levy’s picture

I get errors applying either path on both the RC and dev versions on drupal.org page

drush dl --dev superfish
cd /var/www/vhosts/drupal/modules/superfish
/var/www/vhosts/drupal/modules/superfish $ wget https://www.drupal.org/files/issues/superfish-change-the-order-of-menu-children-2627460-17.patch
/var/www/vhosts/drupal/modules/superfish $ patch -p1 --dry-run < superfish-change-the-order-of-menu-children-2627460-17.patch 
checking file src/Plugin/Block/SuperfishBlock.php
Hunk #1 FAILED at 942 (different line endings).
1 out of 1 hunk FAILED
drush dl superfish
cd /var/www/vhosts/drupal/modules/superfish
/var/www/vhosts/drupal/modules/superfish $ wget https://www.drupal.org/files/issues/superfish-change-the-order-of-menu-children-2627460-10.patch
/var/www/vhosts/drupal/modules/superfish $ patch -p1 --dry-run < superfish-change-the-order-of-menu-children-2627460-10.patch 
checking file src/Plugin/Block/SuperfishBlock.php
Hunk #1 FAILED at 936.
1 out of 1 hunk FAILED

Applying either of them manually to dev version worked just fine.

echoz’s picture

patch #17 resolved superfish submenus made from views not reflecting sort weights. Which of these patches should get RTBC?

jeremyr’s picture

#17 worked for me too but I also had to manually apply the fix.

stephen ollman’s picture

Outstanding. Patch #17 does the job.

texis’s picture

#17 works perfect for me too. Thanks

gchalker@princeton.edu’s picture

Hi,

I had this issue as well. Adding patch #17 fixed my issue with the submenus being out of order.

Note, Patch #10 was already incorporated.

All is well when you are in the submenu pages, yet I lost my dropdowns items when you are on the first level pages.
Almost have the perfect menu.

Can you help?

https://cpanel-dept2-dev-onstott.princeton.edu/research

Geo

levmyshkin’s picture

What's wrong with menu now? I see Deep life > Deep life book submenu. Is it something wrong with other menu item?

chrisfromredfin’s picture

StatusFileSize
new970 bytes

Here's a patch that will work against -rc2.

(It's just #17, but rolled against the rc2 release).

Throwing it here for the free hosting in case someone besides me is using it with composer-patches in their composer.json.

geek.geek’s picture

This has been fixed a long time ago:
http://cgit.drupalcode.org/superfish/commit/?id=66813d1

chrisfromredfin’s picture

@geek.geek; see comment #18 - "Yes, I believe this was patched back in Jan/Feb but it never made it to the published distributions."

That is, what had happened was that the -dev available from the download page was still from an old build, it was never rebuilt (probably an error occurring in the build process).

I can see now that the rc4 and the -dev have today's date on them (Nov 8 '16), so the patch should no longer be necessary; just upgrade to rc4 or later, theoretically.

duaelfr’s picture

Version: 8.x-1.0-rc2 » 8.x-1.x-dev
Status: Needs review » Fixed

This issue has been fixed. Please reopen if needed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wiredescape’s picture

Just a tip for anyone still having sort order issues with child list items on RC5. With fresh install I had to move offending child list item to parent menu, save, then move item back to child menu, save, and then rearrange weight/save within child menu a few more times before sort order finally correct. Something still doesn't seem to be flushing out cache when rearranged.

audriusb’s picture

still a problem in RC-5. #17 fixed it.