If a views page display includes a page with a block display from the same view, the breadcrumb is overriden.

Files: 
CommentFileSizeAuthor
#1 custom-breadcrumbs-1009916.patch1.05 KBpenyaskito

Comments

penyaskito’s picture

Patch attached

MGN’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I am not sure I understand the problem. Block isn't one of the allowed display types (see _custom_breadcrumbs_allowed_display in custom_breadcrumbs_common.inc) so a block display shouldn't be able to override an allowed display (like page, calendar, or image_gallery).

Perhaps this is a more complicated view than I am used to thinking about. Can you describe it further and explain why the logic in the current code is fail to work for your view?

skylord’s picture

Suffering from the same issue. I have a view page with nodes list and 2 blocks from the same view displaying summaries of similar nodes list. Theese blocks also call hook_views_pre_render and overwrite my custom breadcrumb... As they don't have nodes in result - tokens don't work....
Patch supplied above fixes this issue.

MGN’s picture

Status: Postponed (maintainer needs more info) » Needs review
penyaskito’s picture

I have tried to reproduce my own bug and I cannot. @skylord, could you reproduce it and post an example?

spike22’s picture

I can confirm this error with the latest dev version too. Bug still exist
To reproduce the bug:
-create a page view (for example: listing node titles) and create a block view (for example a slideshow or slider)
-put the block to a region and make sure that block is available and present at the page-view
-create a custom breadcrumb for the view or for that path (doesn't mather, neither will work)
Visiting the page, u'll see no change, what i mean the breadcrumb is overwritten.

After going thru and checking the code, changed the "_custom_breadcrumbs_allowed_display" to

function _custom_breadcrumbs_allowed_display($display) {
  $allowed_display_types = array('page', 'calendar', 'image_gallery');
  if (substr($display->current_display, 0, 4) == 'page') {
    if (!(isset($display->handler->view->is_attachment) && $display->handler->view->is_attachment)) {
      if (isset($display->display_options['path']) ) {
        if (module_exists('panels') && panels_get_current_page_display()) {
          return FALSE;
        }
        return TRUE;
      }
    }
  }
  return FALSE;
}

then the custom_breadcrumbs_views died at the 'selecting the path' part. I uninstalled the submodule, and created a 'path' custom breadcrumb. For me that quickly worked, however i personally don't think this would be the right way globally. I just give you the right direction to find the source of the problem. Now I create all custom breadcrumbs by path.
Anyway, thx for this great module, if i can help in any way don't hesitate to ask!