Hi, if you configure a custom breadcrumb title using "title|attribute title" and both titles are empty, the breadcrumb item is generated empty and the breadcrumb will be something like:
breadcrumb before > > breadcrumb after
<!--break-->The fix is easy. Function _custom_breadcrumbs_get_trail_items() needs to check if the $title is "|". Just add && ($title !="|")
to the if:
Correct function:
function _custom_breadcrumbs_get_trail_items($breadcrumb, $titles, $paths) {
$trail_items = array();
for ($i = 0; $i < count($titles); $i++) {
$title = trim($titles[$i]);
if (($title != '') && ($title != '<none>') && ($title !="|")) {
// Create a breadcrumb only if there is a title.
// Include optional html attributes.
$options = _custom_breadcrumbs_identifiers_option($i + 1, $breadcrumb->bid);
$crumb_items = _custom_breadcrumbs_create_crumb_items($title, trim($paths[$i]), $options);
$trail_items = array_merge($trail_items, $crumb_items);
}
}
return $trail_items;
}
Thanks for the attention.
Closed: outdated
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.