Posted by marrch_caat on February 14, 2010 at 9:31pm
3 followers
Jump to:
| Project: | Custom Breadcrumbs |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
The attached patch will improve Active Trail handling in Custom Breadcrumbs.
| Attachment | Size |
|---|---|
| custom-breadcrumbs.patch | 3.89 KB |
Comments
#1
Is anyone interested in testing this?
#2
I have not tested this patch, I solved the problem of menu active trail copying code from menutrails module:
I added from menu_get_item to menu_set_item:
<?phpfunction custom_breadcrumbs_set_breadcrumb($breadcrumb, $objs = array()) {
if ($breadcrumb && !custom_breadcrumbs_exclude_path()) {
$locations = array();
$trail = _custom_breadcrumbs_get_breadcrumb($breadcrumb, $objs, $locations);
if (variable_get('custom_breadcrumbs_force_active_trail', FALSE)) {
menu_set_active_trail($locations);
$item = menu_get_item();
$a = array_pop($locations);
$item['href'] = $a['href'];
menu_set_item(NULL,$item);
}
drupal_set_breadcrumb($trail);
// Optionally save the unique breadcrumb id of the last set breadcrumb.
custom_breadcrumbs_unique_breadcrumb_id($breadcrumb->breadcrumb_type, $breadcrumb->bid);
}
}
?>
this work for me, but I suspect that your patch is more efficient.