I have followed a number of tutorials on this module, yet I cannot seem to get it to work. None of the Menus I create (and then assign taxonomy to, and then move block into a given area) show anything.

I am pretty experienced with Drupal, but am totally stumped by this!

Thanks to all for any help or suggestions.

Comments

fang27’s picture

Title: Menu Not Showing? » Taxonomy Menu Not Showing?
miguel_angel’s picture

Have you any nodes that belongs to the taxonomy you're talking about?

fang27’s picture

Lots - pretty much every node that gets created is required to have a taxonomy term attached.

miguel_angel’s picture

Can you see if the menu links are created but hidden?
You can check that at http://www.example.com/admin/build/menu/list, click on your menu and see if it has any terms and if they have the activated checkbox checked or not.

fang27’s picture

No, there are no items listed under the particular menu (in this case, I simply called it "Taxonomy Menu" so it won't be mistaken for anything else).

Certainly when I am in taxonomy I assign it to the proper menu in the drop down and build, even re-build, the menu items, but nothing appears under the menu listing.

miguel_angel’s picture

This is a strange thing.

Do you get the "The Taxonomy Menu has been updated" message after rebuild?

What other modules have you enabled?
Which version of drupal?

fang27’s picture

Yes, I get:

* Updated vocabulary Manufacturer.
* The Taxonomy Menu has been updated.

Drupal 6.17

Other module include:
CCK, an assortment of Image and ImageCache modules, Pathauto, Token, jQuery, Views, WYSIWYG, and Simple Ads.

All of the other modules seem to work, except for CCK - which I installed but haven't used for anything as of yet.

fang27’s picture

Any thoughts?

qartz’s picture

Same stuff. You can switch "Menu path type" to "Default" - worked for me - menu items are being created successfully.
It definetely does not depend on Pathauto (problem persists with Pathauto disabled).

fang27’s picture

Category: support » bug

Holy smokes, that worked! Thanks for the suggestion! Still, it should work with different Menu path types. Must be a bug. :-p

dsayswhat’s picture

I also can report my menu disappearing - I was using custom paths.

When I flipped it back to default, the menu showed back up. Flipping back to custom paths hides the menu again.

I'm using panels to build the pages associated with this menu...I was adding variant to the panel, and a taxonomy context in the panel as well, and sometime in there, it broke the custom path functionality.

Thoughts?

13rac1’s picture

Component: Miscellaneous » Code

Confirmed in 6.x-2.9. Same fix corrects it. Tested with current dev. Switching back to Custom Path results in:

* warning: html_entity_decode() expects parameter 2 to be long, string given in /var/www/si/sites/all/modules/taxonomy_menu/taxonomy_menu.module on line 577.
* warning: html_entity_decode() expects parameter 2 to be long, string given in /var/www/si/sites/all/modules/taxonomy_menu/taxonomy_menu.module on line 576.

Edit: These warnings are solved by: http://drupal.org/node/689318#comment-3400422. Menus are still not showing though.

indytechcook’s picture

What do you plan on using to display the taxonomy page? Views? Custom page? There has to be a menu callback for the link before the link will be created.

mazz’s picture

I was just wrestling with this problem - if you look in the menu_links table you'll notice that the router_path is blanked out. After much digging I noticed that the menu system automatically returns an empty string (lame in my opinion) if no router is found. In order to find the router the function _menu_find_router_path is called (from menu.inc):

/**
 * Find the router path which will serve this path.
 *
 * @param $link_path
 *  The path for we are looking up its router path.
 * @return
 *  A path from $menu keys or empty if $link_path points to a nonexisting
 *  place.
 */
function _menu_find_router_path($link_path) {
  // $menu will only have data during a menu rebuild.
  $menu = _menu_router_cache();

  $router_path = $link_path;
  $parts = explode('/', $link_path, MENU_MAX_PARTS);
  list($ancestors, $placeholders) = menu_get_ancestors($parts);

  if (empty($menu)) {
    // Not during a menu rebuild, so look up in the database.
    $router_path = (string)db_result(db_query_range('SELECT path FROM {menu_router} WHERE path IN ('. implode (',', $placeholders) .') ORDER BY fit DESC', $ancestors, 0, 1));
  }
  elseif (!isset($menu[$router_path])) {
    // Add an empty path as a fallback.
    $ancestors[] = '';
    foreach ($ancestors as $key => $router_path) {
      if (isset($menu[$router_path])) {
        // Exit the loop leaving $router_path as the first match.
        break;
      }
    }
    // If we did not find the path, $router_path will be the empty string
    // at the end of $ancestors.
  }
  return $router_path;
}

Based off the link path it performs a query on the menu_router table to find if any of the ancestors are in this table and determine proper handling of the link - so if your link path (in my case) is product-catalog/data/product it will perform the following:

    $router_path = (string)db_result(db_query_range('SELECT path FROM {menu_router} WHERE path IN (product-catalog,data,product) ORDER BY fit DESC', $ancestors, 0, 1)

(I swapped in "product-catalog,data,product" so that it's easier to understand)

In my case using ubercart, I wrote a custom module for taxonomy_menu to generate my catalog links properly into a menu. The module grabbed the aliases generated by pathauto to use as the link path. It's simply this small bit of code:

/**
* Implementation of hook_taxonomy_menu_path.
*
* @return array
*  function name => Display Title
*  a list of the path options.
*/
function taxonomy_menu_catalog_path_taxonomy_menu_path() {
  $output = array('taxonomy_menu_catalog_path' => t('UC_Catalog path'));

  return $output;
}

/**
* Callback for hook_taxonomy_menu_path
*/
function taxonomy_menu_catalog_path($vid, $tid) {
  $path = drupal_get_path_alias('catalog/' . $tid);
  return $path;
}

I had to change pathauto to generate my paths as follows: catalog/data/product so that it would find the catalog router that was in the table. I'm not really clear on how these routers are added, I guess on install of the module but I don't have time to investigate right now.

Good luck.

indytechcook’s picture

Thanks mazz, Welcome to the complexity of the menu system :)

The menu router is pulled from hook_menu in modules. THey makes to the real path and not the alias. This is a very common issue.

99% of the time you want to use the default path type and use pathauto to create the alais. This is something I really want to improve.

Side note, you can also use menu_get_item() to get the menu router item for a path.

mazz’s picture

Alright thanks indy - the issue I see is that ubercart does not take into account aliases when it does this:

function _menu_find_router_path($link_path) {
....
  $router_path = $link_path;
  $parts = explode('/', $link_path, MENU_MAX_PARTS);
  list($ancestors, $placeholders) = menu_get_ancestors($parts);
....
}

Shouldn't this be something like:

function _menu_find_router_path($link_path) {
....
  $router_path = drupal_lookup_path('source', $link_path); // should automatically return $link_path if there is no source
  $parts = explode('/', $link_path, MENU_MAX_PARTS);
  list($ancestors, $placeholders) = menu_get_ancestors($parts);
....
}

That would have fixed my issue now that I understand it although I may be overlooking something that would affect other implementations, though I cant foresee that happening except maybe for localization (path language), but I've never utilized that functionality so I can't say.

Anonymous’s picture

I've noticed that taxonomy generated menu's won't show if you include an item for the vocabulary. At least thats the issue I'm having. Any ideas?

stefan81’s picture

Can report the same like #17.

dawnieando’s picture

I can't find taxonomy menu listed in the first place.

I just added a vocabulary and have enabled taxonomy menu.

When going to admin its just not there at all.

Am I doing something fundamentally wrong at my end or is this the bug that you're talking about?

If so, is there a quick fix for now?

Thanks

dawnieando’s picture

Duh, I'm clearly stupid.

I had taxonomy disabled.

Sorry about that.

Seems to be working now.

Apologies.

Garry Egan’s picture

Hierarchical view hides the menu. When I switch to default, it shows it in the block. However, with 100+ categories, it's a monster left-column now. Anyone got a fix for the Hierarchical hiding menu bug?

dawnieando’s picture

I too am having this issue.

When you switch menu to primary links for example it just completely disappears and it seems its always got to be on default.

dawnieando’s picture

Is taxonomy menu settings supposed to show up in /admin as its not doing for me?

Am I doing something wrong or is this a bug?

Its enabled but just nowhere in sight at /admin

Can someone advise please?

Regards

dawnieando’s picture

Sorry if this is a duplicate but I can't seem to find taxonomy menu module showing up in the admin/by-module list at all when its enabled.

Is this a bug or just me. I've looked around the issue posted here and it doesn't seem to say that it should not be listed or listed in the usual way when admin/by-module are listed.

Thanks for your time on this.

dstol’s picture

dawnieando, the settings for taxonomy menu can be found in the edit page for the taxonomy you want to add to the menu.

dawnieando’s picture

I've seen the taxonomy menu settings in the term but having looked at a few tutorials it seems to list 'taxonomy menu' under site building but its not showing there.

Do you have assign a specific menu which you create to taxonomy menu or is it automatic?

Certainly I can't seem to find it under site building on the main admin page which is what the tutorials and the book I'm going through are showing.

Thanks for your help on this.

I appreciate it.

dawnieando’s picture

Do you have to create the taxonomy menu as a menu and then assign the vocabularies?

I'm a bit stumped here.

dawnieando’s picture

Its not showing the ui for taxonomy menu as per this video

http://www.youtube.com/watch?v=Vx1CqYI0BeQ

Is this a separate module from taxonomy_menu?

dawnieando’s picture

Is taxonomy menu V3 a separate module as I can't seem to find V3 anywhere and can't see the UI which a lot of tutorials are showing which is separate from the editable areas in the vocabulary settings. Specifically I'm looking of the section where I can choose whether to 'show this category in menu' - options in the book I'm reading show 'no' or 'normal'.

Can someone help with finding where these options are. Its saying Taxonomy menu V3 but I just can't find it anywhere on the admin page at all.

I've just checked the modules list and taxonomy menu and taxonomy are slighted greyed out but checked. Could this be something to do with the issue?

Thanks

dawnieando’s picture

Now something really mad is happening.

Every time I try to edit a vocabulary and save it it just keeps adding image galleries in multiples of two down the navigation left menu.

surely something is wrong.

dawnieando’s picture

now the navigation page is not rendering at all.

I just rebuilt taxonomy menu thinking that that was going to help but instead it now just showing code when I go to browser to display the page.

Any solutions most gratefully received.

Taxonomy looks like a great thing but I'm struggling here with it.

sorvats’s picture

I have a similar problem, cannot see Taxonomy Menu Settings under site building unless I view it through the Vocabulary terms I created, is the the normal way...?

dstol’s picture

@sorvats, that's the correct way to set settings.

squinternata’s picture

i create a taxonomy vocab and then i added this to a menu i can see the menu but i can t see all the vocabulary items also if i checked rebuild menu after save..
is this the same bug yo are talking about?

tev’s picture

Same here, the taxonomy menu is only build when standard path is selected.

topmet’s picture

Assigned: Unassigned » topmet

same problem,

create menu,
create vocabulary (selected menu + default path)
create terms,
rebuild vocabulary

menu is empty
in table menu_links links exist

musee.informatique’s picture

Drupal 7.0
+ Taxonomy Menu 7.x-1.0

I configure it to put a taxonomy category in the main menu
no taxonomy items in my menu whatever I try to do

but I can see all taxonomy items in the good menu sql table

Here is the first item from taxonomy_menu in my mysql table:
UPDATE `menu_links` SET `menu_name` = 'main-menu',`mlid` = 924,`plid` = 0,`link_path` = 'drupal7/taxonomy/term/1',`router_path` = '',`link_title` = 'Calcul/PDA',`options` = 'a:1:{s:10:"attributes";a:1:{s:5:"title";s:10:"Calcul/PDA";}}',`module` = 'taxonomy_menu',`hidden` = 0,`external` = 0,`has_children` = 1,`expanded` = 1,`weight` = 0,`depth` = 1,`customized` = 0,`p1` = 924,`p2` = 0,`p3` = 0,`p4` = 0,`p5` = 0,`p6` = 0,`p7` = 0,`p8` = 0,`p9` = 0,`updated` = 0 WHERE `menu_links`.`mlid` = 924;

no other menu module or autopath or something like that

any idea ? ^^

dawnieando’s picture

I'm steering clear of taxonomy menu for now. It has issues which I think need sorting out.

reswild’s picture

I'm not getting taxonomy_menu to work at all in Drupal 7. As described above, the menu items can be found in the taxonomy_menu table in the db, but doesn't show up on the site.

Checking my logs, I find loads of theese notices:

Notice: Undefined index: mlid in _taxonomy_menu_create_item() (line 790 of /home/reswild/public_html/drupal-7/sites/all/modules/taxonomy_menu/taxonomy_menu.module).
Notice: Undefined index: vid in _taxonomy_menu_create_item() (line 742 of /home/reswild/public_html/drupal-7/sites/all/modules/taxonomy_menu/taxonomy_menu.module).
Notice: Undefined index: tid in _taxonomy_menu_create_item() (line 742 of /home/reswild/public_html/drupal-7/sites/all/modules/taxonomy_menu/taxonomy_menu.module).

pyotrpro’s picture

Version: 6.x-2.9 » 7.x-1.0

Same to me - not showing - release and dev version - both

reswild’s picture

StatusFileSize
new765 bytes

OK, I figured out why this wasn't working for me. Looking in the menu_links table in my db, I found that the links for the taxonomy menu were being written, but they included the subdirectory of my drupal installation. (So they were written as drupal-7/taxonomy/term/1 instead of taxonomy/term/1, etc).

Here is a quick patch that works for me.

reswild’s picture

StatusFileSize
new882 bytes

Actually, this is probably the right way of writing that:

vitok-dupe’s picture

Priority: Major » Critical

D7 version not work at all!

dstol’s picture

Assigned: topmet » dstol

Can someone send me steps to reproduce and a database dump? I'm having a hard time getting a menu to not show.

reswild’s picture

Did you try with drupal running in a subdirectory on your site?
Like www.example.com/drupal

I'm getting the error on a standard install, with no other extra modules installed except taxonomy_menu.

musee.informatique’s picture

StatusFileSize
new429.41 KB

Here is a sample
Nothing special... I choose the menu I want in a taxonomy list "Menu location" field

The menu link table seems ok but nothing appears in the choosen menu

Installed modules:
Pathologic 7.x-1.x-dev
Gallery Formatter 7.x-1.x-dev
jQuery Update 7.x-2.x-dev
Wysiwyg 7.x-2.0
Linkit 7.x-1.0
Linkit File 7.x-1.0
Linkit Node 7.x-1.0
Linkit Permissions 7.x-1.0
Linkit Taxonomy 7.x-1.0
Linkit User 7.x-1.0
Linkit Views 7.x-1.0
Colorbox 7.x-1.0-beta1
Taxonomy Menu 7.x-1.0

Hope it helps

brewthis’s picture

Same problem here using D7. No menu links showing up at all front-end. They are however visible in the database.

NimbyDagda’s picture

I have the same symptom, but I suspect the cause may be different. When my menus are built, the menu_link table gets the appropriate links generated but they all have blank link_paths. I have tried manually tweaking the table to see if that works but this just results in an error in the core menu code.

UPDATE: And after coming back to after about an hour, the taxonomy_menu table still has the relevant entries, but all of the mlid's it is pointing to are now missing from the menu_links table.

pyotrpro’s picture

I applied patch and paths are correct and all menu links exist at menu_links table of database - but all paths are custom - not like taxonomy/term/* May be that is problem?

Iho Tea’s picture

same problem..
subscribe

jamilshabir’s picture

Same problem as above, using D7 have applied the patch, database showing Link_path fine router_path is empty, but the links don't appear on front end. can someone very clever sort this out for gawds sake.

reswild’s picture

StatusFileSize
new1.03 KB

Yes, when using custom paths for the term pages, the custom paths are written to the link_path field (in the menu_links table) instead of the system paths, while nothing is written to the router_path field.

Here is a patch that removes the url function that are producing the custom paths (and also caused the problems with subdirectories). I'm not quite sure why the url function was needed there in the first place, so this might cause other problems, but it seems to work OK on my test site.

gemu’s picture

same problem, d7 and patch #42 applied but I get "The Taxonomy Menu has been updated." while code says return t('The Taxonomy Menu %menu_name has been updated.', array('%menu_name' => $menu_name)); so i would expect the menu name there...

Anyways, patch #52 seems to have resolved the issue of the links showing up for me. Thank you.

pyotrpro’s picture

It works!! patch #52 Thanx a lot!

xacto’s picture

Thank you reswild!! I owe ya a pint or 2.
:-)

Patch applied to the non-dev version: 7.x-1.0

vitok-dupe’s picture

yep, patch #52 solved problem. thx!

musee.informatique’s picture

great job !!!
patch #52 ok on the taxonomy_menu-7.x-1.0

dstol’s picture

Status: Active » Reviewed & tested by the community

Wee, community! reswild++ I'll have this committed and I'll roll a release out this evening.

Elendae’s picture

Possible to have also the release patched for V6? Thanks a lot :)

dstol’s picture

Status: Reviewed & tested by the community » Fixed

http://drupal.org/cvs?commit=481884

http://drupal.org/node/1027634

Thanks! @Elendae, it's not quite the same issue in D6 and needs a little more work then this but if you're not using custom paths feel free to adapt the code for your needs.

Elendae’s picture

Version: 7.x-1.0 » 6.x-2.9
Status: Fixed » Active

I'm afraid, even if my skills in Drupal are not so bad, my skills in development isn't good enough to correct the module by myself :(.
For the moment, this great module can't be use in D6 with custom path. And without custom path, we can't use it to point at view or panel.

Anyway, really thanks for your work.

dstol’s picture

Title: Taxonomy Menu Not Showing? » Custom path not working correctly
mattcasey’s picture

Can confirm #17 and #18 in Drupal 6 using that setting an item for Vocabulary (at vocabulary edit page) makes the menu items disapper on the Menu List Items page, disabling it then triggers a menu-rebuild and the links return!

Matt

vinnydog’s picture

I can also confirm that only the default menu type is working in 6.x-2.9. Is there any progress on fixing this? Patches above were all for D7...

reswild’s picture

I had a quick look at the issue with menu items disappearing when using Add item for vocabulary. In my case, the menu items are created OK, but old vocabulary menu items aren't deleted when the menu rebuilds. This leads to the active trail being set to the wrong menu item. (That is, it is set to the old menu items that should have been deleted, instead of the new ones that I just created). This means secondary menu items never show up unless I set the menus to be always expanded.

My menu items still show up on the Menu List page though, so this might be a different problem than what is reported above.

yixia’s picture

Title: Custom path not working correctly » I could show the menus now,

Menu path type: Custom path

At first, I set Base path for custom path: products/%(I have a view with argument termid, its path is products), no menu items showen, but I have seen someone upper said the menu items exists in menu_links table, and I checked, that's right.

Just change the path to "products" , remove the "/%" from the path, it works.

zach harkey’s picture

@yixia: You are awesome!

The second I removed the trailing /% from my path the menu was successfully generated. I was going mad.

Needless to say, as cool and useful as taxonomy_menu is, the administrative options and descriptions are confusing at best, and in this particular case following them results in complete failure.

dstol’s picture

Title: I could show the menus now, » [Solved] Custom path not working correctly
Component: Code » Documentation
Category: bug » support
Status: Active » Fixed

Updating title & status

Status: Fixed » Closed (fixed)

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