Somehow my breadcrumb only shows "Home > [Page Title]" when I'm logged in. After much investigation, I've narrowed it down to Node Block is the one causing the problem. The problem is pretty peculiar, the exact conditions are as follow:

  • Menu-based breadcrumbs works fine with Omega subtheme when I'm not logged in.
  • Custom Breadcrumbs doesn't work with Omega subtheme + Node Blocks. Custom Breadcrumbs will show if I disable Node Blocks module.
  • The problem only occurs when I'm using a subtheme. Menu-based breadcrumbs and Custom Breadcrumbs works fine using Omega base theme and with Node Blocks module enabled.
  • drupal_get_breacrumb() returns "Home > [Page Title]" at the preprocess_page level

I'll look into the source and see if I can find out where the problem lies, but I suspect the problem is not limited to Omega subthemes but subthemes of other base themes as well. Your help is appreciated.

CommentFileSizeAuthor
#3 nodeblock-module-breadcrumb-fix.patch659 bytesgoofrider
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

goofrider’s picture

Title: Node Blocks module breaks breadcrumb in Omega subtheme when logged in » Node Blocks module breaks breadcrumb in Omega subtheme + Custom Breadcrumbs
goofrider’s picture

After much digging, I narrowed it down to one place: the node_view() call in nodeblocks.module line 146.

 142     // Set a flag so that themes have more context.
 143     $node->nodeblock = TRUE;
 144 
 145     $block['subject'] = check_plain($node->title);
 146     $block['content'] = node_view($node, $nodeblock_display['teaser'], TRUE, $nodeblock_display['links']);
 147 
 148     return $block;
 149   }

According to Drupal API (http://api.drupal.org/api/drupal/modules--node--node.module/function/nod... ):

node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)

Because the 3rd argument of node_view() is set to true, the nodeblock is rendered as a page and hence changed breadcrumb.

Changing line 146 as follows fixes the problem:

146     $block['content'] = node_view($node, $nodeblock_display['teaser'], FLASE, $nodeblock_display['links']);

It's also still a mystery why it only happens when a subtheme is used.

goofrider’s picture

Here's a patch

goofrider’s picture

Status: Active » Needs review
squarecandy’s picture

Works great for me.
For some reason Breadcrumbs were working for normal page-style nodeblocks, but not when I turned ubercart product nodetypes into nodeblocks... this patch solved it.
Thanks!
- P

chrisfromredfin’s picture

Status: Needs review » Reviewed & tested by the community

This patch works for me. I think it would never be the case that you would be displaying a "nodeblock" as a full page, because then, wouldn't you just be viewing the node? So I think this is the right fix, marking RTBC.

NickMrg’s picture

I'm new in drupal and i have a problem with omega's breadcrumb. It shows only the "Home" in every page. Can you tell me how can i use this patch? Where should i paste this code?
Thanks in advance!

Johnny vd Laar’s picture

Status: Reviewed & tested by the community » Fixed

Committed the fix here:
http://drupalcode.org/project/nodeblock.git/commit/8d4d27d

please tell me if it introduces problems.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Adding Custom Breadcrumbs info