Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Original message by rimen:
http://drupal.org/node/1382060#comment-5779392
Active menus are stored in system variable menu_default_active_menus
and returned by menu_get_active_menu_names()
. Custom menus are added to this variable when menu is saved, in menu_save()
. But sometimes custom menus are not getting to this list. The reason is unknown and I can't reproduce it. If you can, please post steps starting from menu creation.
Comments
Comment #1
Isostar CreditAttribution: Isostar commentedI can confirm this issue
I had the strange behaviour that on site1 the module was working and on site2 with simular configuration it wasn't .
Next, I tested the module on a clean install, and it didn't seem to work. I used a new menu for this.
After reading this issue, I added the terms to an 'original' menu 'navigation' and now the module works.
Any idea to get the module working with custom menu's?
Comment #2
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedLooks like we need a quick fix for this. The reason of problem is still unknown. I'm going to add editor for the list of active menus (to add custom menus to this list). If you know the module implementing such an editor, please let me know. I'll try to search for it too. Probably I'll have free time to do it on this weekend.
Isostar,
Which module and Drupal core versions are you using? On both site 1 and site 2. If you have Menu Block module enabled, please specify its version too.
Comment #3
Isostar CreditAttribution: Isostar commentedOn both websites I used the same versions:
- Drupal core 7.12
- Taxonomy menu trail 2.0
- Taxonomy menu
- (no menu Block)
Website 1 was updated from Drupal core 7.11, website 2 was installed as 7.12.
Apparently this makes a difference.
Website 1 did have the variable 'menu_default_active_menus', website 2 didn't.
This is also mentioned: http://drupal.org/node/1447466#comment-5676712
After changing the schema version of the menu module to 7002 and executing the update the variable appeared on website 2
To see the active menus and order:
I noticed that the active trail is only applied on the active menu which is the first in the list to have the term path.
In my case I had links of term pages in multiple menu's. In order to show the active trail in the correct menu I had to adjust the order:
Comment #4
sokrplare CreditAttribution: sokrplare commentedConfirming that I'm seeing this issue as well.
Did it on a sandbox site with standard Drupal installation and only Taxonomy Menu and Taxonomy Menu Trails installed - specifically:
My steps were:
Hope that helps a bit! I'll keep my sandbox environment setup and can even export and send your way if that would be helpful.
Comment #5
sokrplare CreditAttribution: sokrplare commentedYup, menus schema update fixed it for me too. I've got the database and site files dump to go along with it if that helps, Dmitriy.trt.
With both this module and i18n_menu running into this I'm starting to wonder if a core bug. Or at the least an API shift that both of these modules aren't accustomed to.
Looks like this is also the same thing "-sam-" ran into and just got around by switching to use Main menu (http://drupal.org/node/1413080#comment-5694664).
Comment #6
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedcovenantd,
Thanks for a detailed instruction about reproducing this problem. I'll dig into it on Sunday. Your sandbox would be helpful. Could you please post DB and files of the sandbox here (using some file sharing service)? If you don't want to publish it, please send it to my email.
Comment #7
sokrplare CreditAttribution: sokrplare commentedEmailed!
Comment #8
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedOn a fresh website the variable
"menu_default_active_menus"
will never be created, because inmenu_save()
function the default value contains all custom menus, new menu is not added to the list and variable is not saved. Butmenu_get_active_menu_names()
still returns only system menus, becausemenu_set_active_menu_names()
uses different default value for that variable.But this is not a problem for Drupal menu system, because the list of active menus is used just for menus order and menus are expandable even if they're not in list returned by
menu_get_active_menu_names()
. So, this is a bug in TMT and it will be fixed. Sorry for not providing a fix right now, don't have enough time. For a quick fix use suggestion mentioned above: launchmenu_update_7003()
once after creating at least one custom menu. I'll fix it on the next weekend. Patches are welcome, as always.Comment #9
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedAlso, posted bug report to Drupal core issue queue: #1536410: Custom menus never returned by menu_get_active_menu_names() on a fresh website
Comment #10
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedFix committed. I'm going to release the next stable version (7.x-2.2) tomorrow.
Comment #11
sokrplare CreditAttribution: sokrplare commentedAwesome! Great module maintainership right here!
Comment #12
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedThanks!