My breadcrumb looks like this:

URI: /collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721

Is there any way to improve the crumbs to ignore duplicates?
For each case, I've to do a lots of customization and remove all default crumbs plugins, because they are not working as expected.

Comments

kenorb’s picture

Backtrace:

   10.6882  107456416                     -> _crumbs_PluginEngine->_invokeRule($invokeAction = class _crumbs_InvokeAction_decorateItem { protected $_path = 'collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721'; protected $_item = class crumbs_ItemWrapper_decorateItem { protected $_extra = class stdClass { public $title = 'Year 5 literacy'; public $path = 'collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721'; public $item = array (...); public $alias = 'collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721' }; protected $_array = array ('path' => 'collection/%/%', 'load_functions' => array (...), 'to_arg_functions' => '', 'access_callback' => 'node_access', 'access_arguments' => 'a:2:{i:0;s:4:"view";i:1;i:1;}', 'page_callback' => 'load_collection_member', 'page_arguments' => array (...), 'fit' => '4', 'number_parts' => '3', 'tab_parent' => '', 'tab_root' => 'collection/%/%', 'title' => 'Year 5 literacy', 'title_callback' => 'node_page_title', 'title_arguments' => 'a:1:{i:0;i:1;}', 'type' => '4', 'block_callback' => '', 'description' => '', 'position' => '', 'weight' => '0', 'file' => '', 'href' => 'collection/9143/node', 'options' => array (...), 'access' => TRUE, 'localized_options' => array (...), 'map' => array (...)) }; protected $_method_suffix = '__collection____'; protected $_objects_prepared = array ('menu.hierarchy' => TRUE) }, $rule_key = 'menu.hierarchy:secondary-links') /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.PluginEngine.inc:25
   10.6884  107457680                       -> explode(':', 'menu.hierarchy:secondary-links', 2) /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.PluginEngine.inc:34
                                             >=> array (0 => 'menu.hierarchy', 1 => 'secondary-links')
   10.6884  107458376                       -> _crumbs_InvokeAction_decorateItem->invoke($object = class menu_class_CrumbsParentFinder__hierarchy { protected $_titles = array () }, $object_key = 'menu.hierarchy', $subkey = 'secondary-links') /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.PluginEngine.inc:37
   10.6885  107459336                         -> _crumbs_InvokeAction_decorateItem->_invoke($object = class menu_class_CrumbsParentFinder__hierarchy { protected $_titles = array () }, $m = 'decorate', $subkey = 'secondary-links') /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.decorateItem.inc:28
   10.6885  107461664                           -> method_exists(class menu_class_CrumbsParentFinder__hierarchy { protected $_titles = array () }, 'decorate__collection____') /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.decorateItem.inc:35
                                                 >=> FALSE
   10.6886  107461616                           -> method_exists(class menu_class_CrumbsParentFinder__hierarchy { protected $_titles = array () }, 'decorate') /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.decorateItem.inc:35
                                                 >=> TRUE
   10.6886  107461472                           -> menu_class_CrumbsParentFinder__hierarchy->decorate($path = 'collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721', $item = class crumbs_ItemWrapper_decorateItem { protected $_extra = class stdClass { public $title = 'Year 5 literacy'; public $path = 'collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721'; public $item = array ('path' => 'collection/%/%', 'load_functions' => array (...), 'to_arg_functions' => '', 'access_callback' => 'node_access', 'access_arguments' => 'a:2:{i:0;s:4:"view";i:1;i:1;}', 'page_callback' => 'load_collection_member', 'page_arguments' => array (...), 'fit' => '4', 'number_parts' => '3', 'tab_parent' => '', 'tab_root' => 'collection/%/%', 'title' => 'Year 5 literacy', 'title_callback' => 'node_page_title', 'title_arguments' => 'a:1:{i:0;i:1;}', 'type' => '4', 'block_callback' => '', 'description' => '', 'position' => '', 'weight' => '0', 'file' => '', 'href' => 'collection/9143/node', 'options' => array (...), 'access' => TRUE, 'localized_options' => array (...), 'map' => array (...)); public $alias = 'collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721' }; protected $_array = array ('path' => 'collection/%/%', 'load_functions' => array (1 => 'collection_node_load', 2 => NULL), 'to_arg_functions' => '', 'access_callback' => 'node_access', 'access_arguments' => 'a:2:{i:0;s:4:"view";i:1;i:1;}', 'page_callback' => 'load_collection_member', 'page_arguments' => array (0 => '19500', 1 => 'taxonomy', 2 => '25714', 3 => '25730', 4 => '25712', 5 => '25710', 6 => '25729', 7 => '25726', 8 => '25720', 9 => '25721'), 'fit' => '4', 'number_parts' => '3', 'tab_parent' => '', 'tab_root' => 'collection/%/%', 'title' => 'Year 5 literacy', 'title_callback' => 'node_page_title', 'title_arguments' => 'a:1:{i:0;i:1;}', 'type' => '4', 'block_callback' => '', 'description' => '', 'position' => '', 'weight' => '0', 'file' => '', 'href' => 'collection/9143/node', 'options' => array (), 'access' => TRUE, 'localized_options' => array (), 'map' => array (0 => 'collection', 1 => class stdClass { ... }, 2 => 'node', 3 => '19500', 4 => 'taxonomy', 5 => '25714', 6 => '25730', 7 => '25712', 8 => '25710', 9 => '25729', 10 => '25726', 11 => '25720', 12 => '25721')) }, $menu_name = 'secondary-links') /usr/home/kenorb/websites/doc/trunk/src/sites/all/modules/contrib/crumbs/crumbs.decorateItem.inc:36
kenorb’s picture

Related: #967680: Cannot disable menu.hierarchy:* rule

Done:

---- disabled ----
nodereference.* (wildcard)
taxonomy.* (wildcard)
menu.* (wildcard)
menu.hierarchy:* (wildcard)
menu.hierarchy:navigation (Navigation)
menu.hierarchy:primary-links (Primary links)
menu.hierarchy:secondary-links (Secondary links)
menu.hierarchy:admin (Admin)
menu.hierarchy:features (Features)
menu.hierarchy:menu-footer (Footer Menu)
menu.hierarchy:menu-editor (Editor menu)
menu.hierarchy:menu-footer-sitelinks (Footer Sitelinks)
menu.hierarchy:menu-community-links (Community links)
menu.admin

Still the same;/

donquixote’s picture

Hi,

URI: /collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721

what kind of url is that??
Am I right in assuming that you have a lot of taxonomy terms all with the same name? Or are you setting the crumb title to "Year 5 literacy" all the time?
Are 25714, 25730, 25712 etc all taxonomy term tids?

kenorb’s picture

Yes, those numers are tids.
And collection is custom menu callback: $items['collection/%collection_node/%']
Sometimes I just confused what's going on, because still can't figure out why does it happen. I know that each item should have separated crumbs, but why duplicated? And from where it's came from. I'm using too much xdebug to find out.

donquixote’s picture

If you look at the paths of the crumbs, they seem to be correct, and no duplicates.
Just the titles are identical.
So, what is the title of the terms in question? Do the terms all have the same title? Or is this just crumbs, that is setting a wrong title for the items?

kenorb’s picture

All URIs
collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721
collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720
collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726
collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729
collection/9143/node/19500/taxonomy/25714/25730/25712/25710
collection/9143/node/19500/taxonomy/25714/25730/25712
collection/9143/node/19500/taxonomy/25714/25730
collection/9143/node/19500/taxonomy/25714
collection/9143/node/19500/taxonomy
collection/9143/node/19500 has redirect to collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721
has the same title, but: 'Learning objectives'
Which doesn't appear anywhere in breadcrumb.

Only collection/9143 has 'Year 5 literacy'.

donquixote’s picture

What is the name of the term 25710 ?
What is the name of the term 25712 ?
etc

kenorb’s picture

Different names:

mysql> select name from term_data where tid IN (25710, 25712, 25729);
+------------------------------------+
| name                               |
+------------------------------------+
| 9 Creating and shaping texts       |
| 8 Engaging and responding to texts |
| 10 Text structure and organisation |
donquixote’s picture

Ok, so the correct breadcrumb titles would be something like
9 Creating and shaping texts > 8 Engaging and responding to texts > 10 Text structure and organisation

I imagine this happens because of you changing the path of the items, with your little hack. The code that chooses the title looks at the original path, and then you go and change that path to something else. Then the find() code will find the parent for the manipulated path.

That's my theory. I told you it's a bad idea to mess with the path...
And I think what you want to do can be done quite easily without the hack.

kenorb’s picture

The problem is that probably none of my custom rules are applied in this case.
I really can't figure out which rule generating those crumbs.

donquixote’s picture

Status: Active » Postponed (maintainer needs more info)

What about changing this
collection/9143/node/19500/taxonomy/25714/25730/25712/25710/25729/25726/25720/25721
to this
collection/9143/node/19500/taxonomy/25714,25730,25712,25710,25729,25726,25720,25721
with router path
collection/%collection_node/node/%node/taxonomy/%taxonomy_terms_multiple
with respective wildcard loaders.

Methods with suffix would look like this:
findParent__collection_x_node_x_taxonomy_x($path, $item)

I imagine this would be easier to deal with by the wildcard loader, and you would get the complete info in $item['map']. Core taxonomy does the same, btw - separation by comma.

-----

This entire request is very specific imo, and I think I could more effectively spend my time on it if I were involved in the development of your site.

I recently found an article about faceted breadcrumbs. I think this is very close to what you are describing.
I would very much like to support this idea with crumbs, but I will only work on it if I have a real-world use case. For most of the sites I have worked on (mainly organization websites), the static location-based breadcrumbs are the better solution. (not all of them use crumbs, but probably they will once I feel confident enough about the 2.x branch)

Probably a big part of the code for faceted breadcrumbs would be rather site-specific, but some changes to crumbs core might be required to make them work.

Check out #1048028: Support "faceted" breadcrumbs for search/filter/taxonomy pages.

donquixote’s picture

Please re-open if it still applies and it is still an issue for you. It seems to be quite specific/exotic, and probably only applies in D6.

donquixote’s picture

Status: Postponed (maintainer needs more info) » Fixed
donquixote’s picture

Status: Fixed » Closed (fixed)