An upgrade of Drupal core from 7.10 to 7.12 causes secondary menu blocks to disappear, in spite of the settings in the block interface. I used drush up to perform the upgrade. However, the menu block did not disappear until running drush cc all.

This issue came up with a Main menu (levels 2-4) block assigned to Sidebar First in the Omega theme framework. Changing the top level of the menu to 1st level primary made the menu re-appear, as did re-assigning the block to another random menu, such as Navigation or Development.

I tried creating another menu block with the same settings, and experienced the same issue.

I was able to restore visibility by rolling back upgrades to core and contrib modules. By adding them back one by one and running drush cc all between upgrades, I was able to establish that it was indeed the upgrade to Drupal core that caused the bug.

An image of the menu block settings is attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

leex’s picture

I have also just upgraded from 7.8 - 7.12 using the normal update.txt process and everything is fine except menu block. The menus still appear but nothing more than the 1st level. I have a couple of menu block menus which are doing this.

John Pitcairn’s picture

I can also confirm 7.12 is preventing menu blocks with levels greater than 1 from appearing. Rolling back to 7.11 to see if just the security fixes are OK.

John Pitcairn’s picture

7.11 appears to be OK.

jasondecamp’s picture

Subscribe. Need a fix for this ASAP!

Anonymous’s picture

Can confirm this. All my level 2+ menus disappeared after upgrading! Might have something to do with #942782: Custom menus never receive an active trail which was committed in 7.12.

Downgrading to 7.11 works until this is fixed.

richardhayward’s picture

Priority: Major » Critical

This issue is also affecting our development project at the moment.

leex’s picture

dro0x you are right, mostou talks about it in another issue here: http://drupal.org/node/618700#comment-5430456

bensnyder’s picture

7.12 botched my menus as well - 7.11 seems safe for now.

Tor Arne Thune’s picture

Could this be caused by the same problem that the Internationalization (i18n) module's menu translation submodule has after the commit of #942782: Custom menus never receive an active trail to Drupal core?
i18n issue: #1351678: Follow menu_link_get_preferred active trail handling for custom menus

batigol’s picture

are you guys using i18n ? Turn off Menu translation submodule to check if its i18n fault. If it is, check the link above.

tomwrobel’s picture

@leex, @dro0x: I've been running the patch in #942782: Custom Menus never receive an active trail for months without any problems (on Drupal 7.8). I'm not saying that this isn't the problem, but please consider the possibility that it may not be :)

gargoyle’s picture

Same problem - Just upgraded from 7.9 to 7.12 and sub menus have gone. I'm not running i18n module.

Edit: Got my original version number wrong.

nlisgo’s picture

Same problem and I am also not running i18n upgraded from 7.9 to 7.12.

ajaysolutions’s picture

I've just upgraded from 7.10 to 7.12 without the i18n module and my submenus have gone too!

Anonymous’s picture

@tomwrobel: Possibility considered =) I was just going through the 7.12 changes to see what might most likely be causing this.

Dave Reid’s picture

Ok we're aware of the issue. Please make sure everyone tests if the 7.x-2.x-dev release works or not since it contains updated code since 7.x-2.2. If it's still an issue I'll try to get this fixed tonight.

henrrrik’s picture

I upgraded to 7.x-2.x-dev and it didn't help.

Stijn Vanhandsaeme’s picture

I just tested and I can confirm it has the same problem with the dev version.

jasondecamp’s picture

Updated to 7.x-2.x-dev. Menus Blocks still missing. Thanks for looking into it Dave.

gargoyle’s picture

@Dave, I tried the 7.x-2.x-dev (2011-Aug-17) version but it made no difference. After tracing through the code, it appears that the menu items are not getting 'active_tail' set and hence "pruned" out of the tree when it comes to display the block?

JohnAlbin’s picture

Version: 7.x-2.2 » 7.x-2.x-dev

Ok. So still broken in 7.x-2.x-dev. Roger.

Dave Reid’s picture

Version: 7.x-2.x-dev » 7.x-2.2
Status: Active » Needs review
FileSize
592 bytes

Here's the first patch to try.

Dave Reid’s picture

Revised patch.

anou’s picture

getting this error when patching :
Fatal error: Call to undefined function __menu_block_set_menu_trail() in .../sites/all/modules/menu_block/menu_block.module on line 262

Oups must try the new patch :-)

jasondecamp’s picture

#23 works for me, nice quick fix Dave!

angelg33k’s picture

I've applied the patch, but nothing happened. No errors or anything, the menu block just does not show up. I've cleared the cache and all that jazz.

jasondecamp’s picture

@angelg33k - try rebuilding the theme registry in addition to cache clearing. for me the patch didn't take effect until I had done that for some reason.

angelg33k’s picture

@jason: thanks. I've run drupal_flush_all_caches(), that's supposed to do the trick, right? Or is there another all mighty clear thingy? Still nothing.

The condition if (!defined('MENU_PREFERRED_LINK')) does not evaluate as true in my application, if that helps you, Dave.

HnLn’s picture

patch didn't work for me either (cache clear + registry rebuild).

JonMcL’s picture

Patch at #23 did not work for me.

Block is 1 level deep, starting at 2nd level.

Cleared cache & theme registry.

azarzag’s picture

#23 worked for me. Running Drupal 7.12 and Menu block 7.x-2.2.

Thanks

Stijn Vanhandsaeme’s picture

Dont't know if it makes sense to add:
#23 worked for me. Running Drupal 7.12 and Menu block 7.x-2.x-dev.
Thank you!

JohnAlbin’s picture

I just committed this patch. The patch in #23 wouldn't work for new installs.

You need to clear cache. Which can be done by clicking the "Clear all caches" button on admin/config/development/performance or going to /update.php.

Ollie222’s picture

Patch #23 worked for me, thank you for the fast response and update.

I'll try patch #33 later on.

bensnyder’s picture

The latest code...
git clone --branch 7.x-2.x http://git.drupal.org/project/menu_block.git

...fixed it for us perfectly. Thanks for the speedy patch!

angelg33k’s picture

Patch #33 just crashed my whole site, I get a Call to undefined function __menu_block_set_menu_trail(). My main menu doesn't get the active trail anymore either. When I had 7.10 they did, but with 7.12 they don't.

bensnyder’s picture

@angelg33k try deleting the module and then check it out via git

angelg33k’s picture

@bensnyder I've tried the 2.2 version, the dev version and checked it out from git. Nothing works. It won't show up.

I'm starting to think something else is wrong. Which module is responsible for putting the "active-trail" class on the menu links? Is it the menu module? Cuz I don't get those anymore.

angelg33k’s picture

I've updated from 7.10 to 7.12 today and I've also updated the Token module to rc1, does that module have anything to do with this?

Jonathan Baltazar’s picture

Confirmed: patch in #23 worked. Nice one, Dave.

colinafoley’s picture

Replacing my existing menu_block directory with the clone suggested in #35 did the trick. I'll be back if I see something else happening.

colinafoley’s picture

Will this be placed into a release anytime soon?

killtheliterate’s picture

I've also had success checking out the version in #35.

artis’s picture

Status: Needs review » Reviewed & tested by the community

Success deleting existing menu_blocks folder and checking out #35.

JonMcL’s picture

Still no success for me.
I just checked out from git and used the entire folder. Still no 2nd-level, 1-level deep block. By 1st-level, 1-level deep block works, but I think it worked with v12 fine.

ZeiP’s picture

I am also experiencing the problem despite trying the suggested fixes.

setvik’s picture

No success for me either.

I tried both #23 and #35 and my menu_block configured to show only the 2nd level of the main menu does not show up anywhere

julianms’s picture

Hi !

I understand there are major updates (upgrades - like passing from 6.1 to 7.1) and minor updates (like 7.10 --> 7.12).
I have 7.10.
If I want to have 7.12 can I do it through Dashboard ? (like updates for modules ?)...

Because I have many new modules installed, many settings ... It would take me (again) weeks to get there, if I begin from start.
Is there a link with details about "minor" updates ?

Thanks !

richardhayward’s picture

#35 worked for us.

BernieCram’s picture

Patch at #33 works for me, thanks for the speedy fix.

B

batigol’s picture

This is strange. I'm using i18n module and with patch from http://drupal.org/node/1351678#comment-5498090 everything works fine. I don't need to use any patch from here.

bensnyder’s picture

@julianms follow the UPGRADE.txt file instructions.

kim.pepper’s picture

Confirm that latest dev version as suggested in #35 works.

C. Lee’s picture

Status: Reviewed & tested by the community » Needs work

Tried #35 with no success.

webchick’s picture

Note that by now, this commit is in the 7.x-2.x-dev release. Shouldn't be any need to monkey around with Git.

ajaysolutions’s picture

Status: Needs work » Reviewed & tested by the community

Just installed the new dev release, and it's fixed my problem, thanks guys!

Tino’s picture

Yesterday afternoon I updated 5 production websites to 7.12, but had to roll them all back to 7.11 that evening after finding out submenus were not working anymore.

I just updated menu block on a developement website to 7.x-2.2+15-dev (2012-feb-03). It's exclusively dependant on 7.12. After updating to 7.12 it appears submenus are still not working nor being displayed. Starting level is 2nd, max. depth is 1, title is shown as link. Thanks for your hard work people! Hope you'll find a nice fix soon.

HnLn’s picture

OK, patches didn't work for me either but then I also applied the i18n patch mentioned in #51: http://drupal.org/node/1351678#comment-5498090 and it works for me 2 now.

klonos’s picture

Yeah, could everyone that reported failure please also apply that patch and test again? ...that is if you are using i18n.

Ollie222’s picture

Status: Reviewed & tested by the community » Needs work

Drupal 7.12 and 7.x-2.2+15-dev (2012-feb-03) has fixed my issues but none of my sites use internationalisation.

Mangostaniko’s picture

Status: Needs work » Reviewed & tested by the community

Installing the patch in #51 for i18n_menu and running update.php solved the problem for me. Thank you for the hint!

Tino’s picture

Strange, I am also not running i18n, yet 7.x-2.2+15-dev (2012-feb-03) did not solve it...

klonos’s picture

@Tino: which version of i18n? Did you apply the patch for i18n?... http://drupal.org/node/1351678#comment-5553284

Tino’s picture

I am not running i18n/internationalization. Do you want me to upgrade to 7.12 and dev to test again?

jummonk’s picture

For me it was solved by using the D7.10 (or D7.11) version of function menu_link_get_preferred() in includes/menu.inc.

nmc’s picture

Downloaded version 7.x-2.x-dev via drush over top of my current module and it seems to have fixed the issue for me. I'm not using i18n/internationalization and I have core v 7.12 installed.

Tino’s picture

Tested it all again:

  1. Update from 7.11 to 7.12
  2. Update to menu block 7.x-2.2+15-dev (2012-feb-03)
  3. Clear cache

Now it works!
I have not applied any additional patches.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Great I think we can mark this as officially fixed then.

JonMcL’s picture

Okay .. success!

I have i18n installed so once I hooked up patch for i18n_menu all worked.

Thanks!!

JohnAlbin’s picture

I'm going to roll a new menu_block 7.x-2.3 now that we've confirmed this issue is fixed.

ronvu’s picture

Thx 4 this fix!

modulist’s picture

Thanks everyone for working so quickly on a fix! It's great to see the community in action.

samwillc’s picture

Can I just also say a huge thanks to everyone who worked so quickly to fix this. Shows great community spirit!

Thanks again.

Sam.

nlisgo’s picture

A big thank you! Great work responding so quickly to this.

Anonymous’s picture

Worked for me as well. Thanks all for fixing this so quickly!

anou’s picture

Just to mention for those using i18n, don't need to patch i18n any more. Correct install today is :

  • Drupal 7.12
  • Menu Block 7.x-2.3
  • Internationalization 7.x-1.x-dev

And thanks again !

batigol’s picture

If you don't use Menu Block then you need i18n fix.

dimitriseng’s picture

Using D 7.12 + i18n, I can confirm that it all looks to be working ok now using the modules as specified in #76. Thank you very much!

Nor4a’s picture

I just have upgraded to 7.12 and i had exactly the same problem with active menu trail for custom nodes (not for node type "Basic page"). I was using Nice Menus block (not the Menu Block), but when I upgraded to Menu Block 7.x-2.3 it solved the issue. Strange... I do not see any dependencies defined between Nice Menus and Menu Block. But it works :)
Thanks!

angelg33k’s picture

I just upgraded to i18n 7.x-1.4 and my menus are back! Thanks everyone!

rvilar’s picture

Status: Fixed » Active

I still have the problem with custom menus. I've tested with:

- Drupal 7.12
- Menu block 2.3
- Internationalization 1.4

boran’s picture

My secondary menus were not displaying either after the 7.12 upgrade.
It was great to find this thread, thanks guys.
After upgrading i18n to 7.x-1.4, menu_block to 7.x-2.3, clearing caches and applying updates, the menu appeared again.
So, perhaps the problem with #81 was not clearing caches or running the dbupdate?

Frederic wbase’s picture

My experience with this issue:

After upgrading to drupal 7.12 the active trail wasen't set any more. Also not an regular menu's printed without menu block. Menu block isen't even installed on my site.

The problem for me was the i18n module, after updating that one to 1.4, running db update & clearing caches the problem was solved.

A little bit investigation learned me that there used to be a problem with active trail in drupal core that now has been fixed, but contrib modules need to implement these changes also.

My tip, if you have the same problem with drupal 7.12, check if you have any contrib modules that alter the menu on any way, and check if they need to be updated.

grts

fre

alexio2170’s picture

Hello, since I cannot get out of this problem, I've installed a new 7.12 version from scratch. No way to see a second level menu item.
I've tried to use 7.x-2.3 menu block module but it didn't work at all.
I've installed nothing else and there's no content.
I cannot see the light at the end of the tunnel...

pjcdawkins’s picture

Menu Block (7.x-2.2, 7.x-2.3, and 7.x-2.x-dev) is the module causing my Drupal 7.12 site to run out of memory on viewing any node, despite having 512MB available.

JamesOakley’s picture

@pjcdawkins - that doesn't sound as though it's related to the issue on this thread, which is specifically about Menu Block failing entirely when Drupal core is updated from 7.10 or 7.11 to 7.12. I suggest you open a separate thread.

pjcdawkins’s picture

@JamesOakley, thanks, it was actually caused by strict errors: I found a home for the problem in http://drupal.org/node/1318210#comment-5584944.

etron770’s picture

It seems that it is any conflict with other modules
Same server and same webspace
http://an.heavycargova.org 7.12 working
enabled modules (scroll down) : http://heavycargova.org/temp/an_modules.pdf
http://heavycargova.org 7.12 not working enabled modules: heavycargo_modules.pdf
enabled modules (scroll down) http://heavycargova.org/temp/heavycargo_modules.pdf

maybe together we can find reason ...

timtunbridge’s picture

fyi - if you are considering a downgrade to 7.11 be aware of http://drupal.org/node/1430404 (see ticker http://drupal.org/node/1425092).

So you might be better off sticking with 7.12 and the above patches.

This also appears to be impacting menu_position which has its own patch for 7.12 http://drupal.org/node/1426482.

mlecha’s picture

Some of my menu blocks fail to display in my custom theme or Bartik. The HTML just doesn't appear. And it only on SOME pages. Others work fine. (I've cleared the cache, changed themes, deleted the menu cache from the database out of desperation...)

I'm wondering if re-running the database update provided in Drupal 7.12 upgrade could help?
http://api.drupal.org/api/drupal/modules!menu!menu.install/function/menu_update_7003/7

Where could I insert that code to run the upgrade again?

I initially upgraded 7.10 to 7.12 THEN upgraded to Menu Block 2.3 and i18n 1.4. But now they are fixed perhaps I should try doing the reverse (from backups)? (Still working locally while some of the custom menus are broken.)

Also using the patched version of Menu Postion 1.0.

Thanks for any insight!

Frederic wbase’s picture

As i've already said, i think you should search the problem in contrib modules related to the menu or i18n/l10n.

grts

frederic

etron770’s picture

I solved the problem with doing an update of I18n to 7.x-1.4

mlecha’s picture

rvilar, Fixed yet? You cleared the caches? Ran the db update from 7.12?

etron770’s picture

I did only the update from i18n including database update, nothing else ....

But I have menu-block Menu block 7.x-2.2

Updated to Menu block 7.x-2.3 .. its working

mlecha’s picture

Since upgrading to 7.12 the last leaf of my custom menu doesn't appear. This seems related to the menu fix in 7.12, but I'm not sure how.

Why would prevent Drupal from outputting full HTML of the menu? (Please see missing HTML pasted below.)

I've to upgraded i18n 1.4, Menu Block 2.4 (with 'include parent' patch), and Menu Position 1.0 (patched with 7.12 fix).

Drupal 7.10 works great, the last leaf "history" is being output by Drupal

Working - the last leaf "History" is there

Drupal 7.12 is missing that last leaf

Not Working

The MISSING HTML that Drupal doesn't output any more, just before the last DIV:

gsquirrel’s picture

I had this issue after core upgrade - but after doing updates suggested here the second level menus came back and i thought it was fixed.

But new items created in the same menu are not working. So some menu items work fine and others dont, and I can't find any difference between them that would explain it. I have tried everything i can think of - creating new page and new menu item doesnt work and that is why i think it is the new items affected.

It is set to show as secondary menu so only shows on pages that are in the menu in theory - and when it shows for the pages that do work i can see the menu items that are not working, but go to those pages and it dissappears.

I am using i18n but upgraded to i18n 7.x-1.4 , menu blocks is on menu_block 7.x-2.3

I suspected language issues but have removed and switched off languages for this menu and nothing makes any difference. Any help much appreciated

vollepeer’s picture

Version: 7.x-2.2 » 7.x-2.3

See also http://drupal.org/node/1447466 for more info regarding fresh Drupal 7.12 installs (no core update)

gsquirrel’s picture

Discovered that a menu position rule was involved in my problems - disabling it brought menu back - but i needed the rule too so then found this issue which had one line patch in it http://drupal.org/node/1426482

I had thought that the main version had been updated to overcome core update issues already but seems like it is only applied in a dev version.

ajaysolutions’s picture

I've been having a look at a lot of these menu issues, as I just realised I had some! Despite being on the latest dev version of menu block. I have found since going from 7.10 to 7.12, that some of my menu items aren't listed in the admin interface for the main-menu links. I found this problem whilst trying to update a view and it wouldn't replace my menu item from views, so I initially thought there could be a views bug, but not so, they weren't being displayed in the admin interface.

I looked through the menu links table in the database to find all my menu items are still present, but for some reason they don't get recognised by whatever changes were done in D7.12 so I have manually cleared out all the entries in the database that weren't showing up correctly, and re-created them the same way they were created before. This time they all re-appear correctly, and menu position rules are working again as well!

Could this be a drupal core bug caused by upgrading from 7.10 to 7.12?

Btw I should say that this has only caused issues for anything with a depth of 2!

tracker2k’s picture

patch #23 works perfectly

mgifford’s picture

I didn't have success with the git repo & i18n.

EDIT: I'm still looking at this issue. Trying to nail down a simple way to get down to replicate things on a PHP level with this problem.

If I insert this in a block in PHP:

echo "<pre>";
print_r(menu_tree_page_data('main-menu', 1, TRUE));
echo "</pre>";

I should have access to an array with only the active menu trail for the 'main-menu' menu, right? In my case [link][in_active_trail] is NULL for all returned values.

rypit’s picture

Please see: #1351678: Follow menu_link_get_preferred active trail handling for custom menus
http://drupal.org/node/1351678#comment-5582922
Running the following versions and this problem seems resolved:

  • Drupal 7.12
  • Multilingual - Internationalization (i18n) 7.x-1.4
  • Menu Block (menu_block) 7.x-2.3
gsquirrel’s picture

If you are also using menu_position module you will need that patch too

Mitsuko’s picture

// Sorry, ignore my comment below, this is not an issue for menu block, my bug came from my theme which have a preprocess function theme_menu_link, reset to bartik and bug was away. //

Leafs dont' appear when i check "Expand all children of this tree".
I can only have one level of children displayed
I think It's the same problem than mlecha http://drupal.org/node/1425342#comment-5620080
Try Menu block 7.x-2.3 + Drupal 7.12 and Menu block 7.x-2.dev + Drupal 7.12
I don't use i18n.

// Sorry, ignore my comment above, this is not an issue for menu block, my bug came from my theme which have a preprocess function theme_menu_link, reset to bartik and bug was away. //

mich990’s picture

I've got the same problem. No submenus displaying after an upgrade from 7.10 to 7.12 on GoDaddy.

I've upgraded Internationalization to 1.4 and submenus appeared again!

leanderl’s picture

Phew, I just spent a gazillion hours trying to get a sub level menu with numerous methods including writing my own module. That's when I discover active trail is set to false on active trails... I just wish I had looked here earlier, or that the current "dev" version of the module would have been the regular version, or that Drupal 7.12 wasn't broken.

Everything working now with Drupal 7.12 and Menu block 7.x-2.3+1-dev... Thanks for the bug fix!

Craigo’s picture

I'm still somewhat of a Drupal newbie so please bear with me!

I'm running Drupal 7.12 and Menu block (menu_block) 7.x-2.3 and am losing my sub level menu when the top level is set at 2nd level or 3rd level.

Here's what happens when top level is set at 2nd level:

1) Sub level menu is attached to basic page content type
2) When "Menu settings/Provide menu link" box is checked sub level menu appears
3) When "Menu settings/Provide menu link" box is not checked sub level menu disappears

I would like to be able to create pages and not always have them linked in the sub level menu but still need to have the sub level menu appear on the page. Also, I need to have the 1st level page linked and appearing in the sub level menu header. Finally, I need the 1st level page to appear in the breadcrumb.

Are these requirements beyond the Menu block module or is my menu_block configuration not correct, or is there another module or series of modules I should consider?

Thanks!

pjcdawkins’s picture

Hi @Craigo (#107). Your message is off-topic, so it should be a separate 'support request' issue, or posted in the support forum.

But I'd suggest you have a look at the Menu Position module, which I think will solve your problem.

mostou’s picture

Status: Active » Fixed

Lets see if we can close this. It was fixed some time ago. If you experience any issues try update to latest versions of your modules, run db update and clear caches.

dmcdenissen’s picture

I just updated all my modules incl. Drupal core to 7.14 and it's still not working...

Drupal 7.14
Menu block 7.x-2.3+1-dev
i18n 7.x-1.5+11-dev
Menu Position 7.x-1.1

[Update]

For some reason wenn I disable the i18n Module "Menu Translation" they work. Seems to be a i18n problem...

[/Update]

LoyC’s picture

Status: Fixed » Active

I can confirm #110

JamesOakley’s picture

Status: Active » Fixed

@LoyC: The person who posted #110 subsequently worked out that they had an issue with the i18n module; this issue has been fixed. If you are having problems getting the menu block to work, I suggest opening a new issue in which you detail the exact problem you have.

Status: Fixed » Closed (fixed)

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

yang_yi_cn’s picture

If any one still following this, I got the same issue with #110, and I believe it's rather a core issue instead of i18n issue.

created #1710744: Custom menus never receive an active trail (but system menu does)