in Drupal 6:
Array › Array › breadcrumb for stories categorised by taxonomy

and only Home > in uncategorised stories

In Drupal5 breadcrumb is Ok, in Drupal 6 is not

Comments

keith.smith’s picture

Priority: Critical » Normal

I can't quite parse this bug report. Can you elaborate?

Regardless, a breadcrumb issue is surely not critical.

zet’s picture

  • I have made some vocabularies and to each vocabulary some terms
  • I wrote some stories and categorised them by a unique term
  • I have downloaded taxonomy menu and generate a menu from taxonomy -> that creates the menus by default in navigation menu.
  • I have moved those taxonomy menus from navigation to primary links

    - In admin/build/menu/settings i have :

  • Source for the primary links: Primary links
  • Source for the secondary links : Primary links

    When a go to display a story node, the breadcrumb shows Array > Array
    I tested this on Zen, Garland, and Internet Center themes for Drupal6

    For the same steps like above, in Drupal5 the breadcrumb is ok. Here, when i display a node , the breadcrumb is : Vocab > Term

  • catch’s picture

    Project: Drupal core » Taxonomy Menu
    Version: 6.0-rc4 » 6.x-1.x-dev
    Component: other » Code

    Moving to taxonomy menu.

    zet’s picture

    is anyone who does not get this breadrumb error in Drupal 6 with taxonomy menu ?

    MatthijsG’s picture

    Subscribing.

    Want to know how to get rid of "Array » Array »"

    ecuadorbob’s picture

    I have the same problem:

    http://localhost/drupal6/taxonomy/term/10 gives me the breadcrumb I want...

    http://localhost/drupal6/node/2 (a node with the term #10) gives me 'Array › Array'

    This is definitely a bug,

    zet’s picture

    Actualy I'm not sure if this a taxonomy menu issue.
    Can someone confirm if the breadcrumb menu is showing without problems on drupal 6 an tell what extra modules they have installed

    TSE’s picture

    Hard to say, if tax menu is disabled the path shown in breadcrumb is only "Home".

    So i would thing its not a taxonomy menu issue, cause the path isn't shown without it anyway. Looks more this module dont get the right variables so it displays array.

    For me it looks more like a drupal core issue.

    Greetz TSE

    yelban’s picture

    I got same problem, too.
    need help!

    yelban’s picture

    Status: Needs review » Active
    StatusFileSize
    new2.11 KB
    new2.82 KB

    I have edit the taxonomy_menu.inc and got the breadcrumb work at node view,
    just chang the drupal_set_breadcrumb() statement in taxonomy_menu.inc line: 230

          if ($term->tid == $vocab[0]) {
          	$links = array(l(t($term->name), $path), l($node->title, 'node/'. $node->nid)); 
          	drupal_set_breadcrumb($links);
            // remark for node view breadcrumb, changed by Yelban (yelban@gmail.com)
            // demo http://orz99.com/twapms 
            // drupal_set_breadcrumb(array(
            //   array('path' => $path, 'title' => t($term->name)),
            //   array('path' => 'node/'. $node->nid, 'title' => $node->title)
            // ));
    

    before: attachment 2

    after: attachment 1

    TSE’s picture

    Title: Array › Array › breadcrumb » Array › Array › breadcrumb (hacks)
    Status: Active » Needs review

    Hi yelban, good work this fixes the problem !

    Many thX TSE

    offtopic : since this looks like a patch to the problem i set the status to patch (code needs review), hope this is ok ?

    AndyW’s picture

    cheers yelban, works fine

    yelban’s picture

    Hi TSE

    sure, that's okay you change the status to any type. ^^

    thXs a lot for the good module :)

    Aethuriel’s picture

    Status: Active » Needs review

    Thank you, yelban!

    Although the patch worked, I had the Custom Breadcrumbs module to also deal with --

    So the patch actually helped me realize I could comment OUT whole c. line 230 "if" statement (including your patch) in order to let the Custom Breadcrumbs module do its magic. Taxonomy menu was overriding my Custom Breadcrumbs settings whether it was Array >> Array or categories as per your patch.

    kinky69’s picture

    Hi, it dont work with my theme (marinelli). The code in taxonomy_menu.inc is different:

    // Generate the entire breadcumb
    foreach ($tree as $term) {
    if ($term->depth <= $old_depth) {
    $slashes_to_remove = $old_depth - $term->depth + 1;
    for ($i = 0; $i < $slashes_to_remove; $i++) {
    $old_path = substr($old_path, 0, strrpos($old_path, "/"));
    }
    }
    $path = $old_path .'/'. $term->tid;
    $old_depth = $term->depth;
    $old_path = $path;

    // When we reach the term that this node uses,
    // set the breadcumb
    if ($term->tid == $vocab[0]) {
    drupal_set_breadcrumb(array(
    array('path' => $path, 'title' => t($term->name)),
    array('path' => 'node/'. $node->nid, 'title' => $node->title)
    ));

    // Quit after the first match.
    return;
    }
    }
    }
    }

    Is there anything i can dohere too ???

    tf5_bassist’s picture

    I've had the breadcrumbs working just fine so far, but then I log in today, and there was an update for Pathauto AND the Drupify theme... after updating these, I'm getting the Array > Array breadcrumbs showing up. Definitely not critical, but annoying for sure.

    Edit: When editing the story, the breadcrumbs show up properly. Could this instead be an issue with the new Drupify snapshot?

    drq’s picture

    Thanks. I have this problem too. Tomorrow check that hack.

    tf5_bassist’s picture

    Good stuff, working so far.

    Notes: When Viewing a story, breadcrumbs show taxonomy term the story belongs to, and then the name of the story. when Tracking or Editing, it shows Home instead of the term. And even if it's a nested term (Home > Social Networking > Twitter > Article name), it only will show Twitter > Article Name.

    this an issue, or a normalcy of Drupal?

    ninelives’s picture

    Based on the comments by yelban in post #10 I've been able to get my breadcrumb working mostly the way I expect with pathauto by using this code. I'll like to extend this to do recursive vocab, but for now I'm happy.

    if ($term->tid == $vocab[0]) {
    
    	  drupal_set_breadcrumb(array(
               l(t($term->name) , drupal_get_path_alias( taxonomy_term_path($term)) ), l( $node->title , drupal_get_path_alias('node/'.$node->nid))));
    	
            // Quit after the first match.
            return;
          }
    
    tf5_bassist’s picture

    So, after switching over from Drupify to Marinelli, still having this problem... With or without Yelban's fix (which worked in Drupify). Anyone have any thoughts or ideas?

    lentreprenaute’s picture

    Hi all,

    I create new content type with CCK, I met the same problem....

    i created a taxomany hierarchy. like (directory my new content) : vocabulary1> term1> term2.

    So from the home page if i click on the title, i have "array array", when i click on taxonomy term, it's work fine.

    So i'm newbie, not fluent in english... Hope you understand and helping you.

    Working on the basic template which come with the first install...

    Florent

    zet’s picture

    Assigned: zet » Unassigned
    Priority: Normal » Critical
    anikey’s picture

    if ($term->tid == $vocab[0]) {
    drupal_set_breadcrumb(array(
    /*array('path' => $path, 'title' => t($term->name))*/
    l(t($term->name), $path),
    /*array('path' => 'node/'. $node->nid, 'title' => $node->title)*/
    l($node->title, 'node/'. $node->nid)
    ));

    // Quit after the first match.
    return;
    }
    it's works

    chrissearle’s picture

    #23 confirmed here.

    pathogen’s picture

    confirmed as well.. the Array > Array issue is gone

    I am noticing some inconsistencies with the breadcrumbs though, but anything is better than array array!

    Anonymous’s picture

    Just want to confirm #23 works for me, too

    I wonder if it's okay to just place an HTML link there, as that would make it more difficult for other modules to handle the breadcrumbs.

    tf5_bassist’s picture

    Eh, didn't work for me on D6.3. I don't know what my problem is haha... I tried the fix in #23, I'm running Marinelli, I've tried a fix in Marinelli, I've tried disabling other modules, and i'm either getting "Node Name/Node Name" without any plugins, or "Array/Node Name" with modules running.

    dthiessen’s picture

    Same problem here...

    Subscribing

    rainer_f’s picture

    #10 works great for me with Pushbutton Theme. Hope it stays in any tax menu updates!

    yngens’s picture

    #23 solves array > array issue, but when you press on the term name (http://mysite.org/category/5/23), generated by l(t($term->name), $path) it gives:

    Access denied
    You are not authorized to access this page. 

    Going to 'category/5/23's alias by pathauto '/rubrics/culture' properly opens the page. I wonder how can I make $path in 'l(t($term->name), $path)' to link to path's alias, not $path itself?

    petertj’s picture

    subscribing...

    xanga2008’s picture

    Subscribing..

    manan’s picture

    Where is taxonomy_menu.inc?

    mntoner’s picture

    I am using Drupal 6.4 with pushbutton theme. Please can someone tell me how to fix the breadcrumb for the primary menu. Thanks

    rimma’s picture

    same issue here. Subscribing..

    Afief’s picture

    Status: Needs review » Fixed

    Fixed in head. You can checkout the latest HEAD or try the Drupal6-dev version when it gets packaged tomorrow morning.

    Note: the fix is a bit more extensive than what was posted here so even if you applied the patches mentioned here you might wanna try it out.

    chrissearle’s picture

    Dev version confirmed for me.

    It's changed which vocab it picks from compared to the hacked version from here - but - it is picking up a vocab and term :)

    I guess it picks the lightest weight vocab and the lightest weight term from that vocab (if more than one term is applied)?

    Afief’s picture

    That's true. The lightest term from the lightest vocabulary that has has an active menu(set in the taxonomy module configuration page)

    I know this isn't exactly optimal(it doesn't care about other terms, or terms with multiple parents...etc) but I see no way to get around this as each page should have only one path defined when it's in the menu. Any suggestions are more than welcome.

    chrissearle’s picture

    No - I agree - I couldn't see a better solution there

    Anonymous’s picture

    Status: Fixed » Closed (fixed)

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