Horrid.
I found that using node_breadcrumb on a site that also had ctools enabled meant that although the menu and breadcrumbs were correctly relocated (nice), the local tabs were wiped out.
Which made node pages underneath a node_breadcrumb rule unmanageable - there was no 'edit' tab.
After much digging, I discovered that the blame lies upon ctools - and partially on the tricky way that node_breadcrumb tricks the system into displaying local menu items on a page that is pretending to be elsewhere in the menu.

So.

_node_breadcrumb_set_location() does something sneaky. Before it changes the menu item with menu_set_item, it prematurely calls menu_local_tasks() - a function that builds the local tabs.
drupal core caches that result, and the normal result is we get the tabs - as they were expected to be - later when the page gets rendered.
... note that this process is deliberately fooling drupal core into producing the results we want, which is why it's "sneaky".

However.

if you have ctools on your site, ctools decides to override core behavior, and ignores that trick. It uses ctools/includes/utility.inc:ctools_theme_registry_alter() to break core functionality and replace it with its own version of the theme_menu_local_tasks. So our node_breadcrumb changes are destroyed.

I never asked for that to happen. Thankyou ctools, you think you know what's better on my site than I or Drupal do. :-/
So arg!

Either we break it right back with our own theme_registry_alter (which is just a revert war)
or we tell ctools to do what we want also.

in _node_breadcrumb_set_location()

  // Calling these two functions here means that the results will be statically 
  // cached until render time.
  // So we SHOULD get the real local tasks displayed on the page,
  // even after the menu has allegedly been moved.
  menu_local_tasks(0);
  menu_local_tasks(1);
  // ** FUCK **
  // ctools overrides the core menu_local_tasks process, so this process does not work.
  // But ctools version also caches. So make it do that.
  if (module_exists('ctools')) {
    module_load_include('inc', 'ctools', 'includes/menu');
    ctools_menu_local_tasks(0);
    ctools_menu_local_tasks(1);
  }

not elegant.
but ??

Comments

alison’s picture

wow, thank GOD (this totally worked for me). i was about ready to die of frustration with this problem. at this point "not elegant" is "not something i care about even a little bit" :) thank you!!

joachim’s picture

I confirm the fix works, though when I cloned git to look at making a patch I found that the 6.x-dev branch doesn't have the menu_local_tasks(0); lines in it... (though it still has the same bug).

(BTW, I also often swear like a sailor in my code, but do remember to clean it up before posting it to d.org... ;)