Hi,

I'm using Custom Breadcrumbs for views and have a strange issue. The view I am using is the default og_tab_blogs view.

The issue is this: I have breadcrumbs to print the following paths and titles:
TITLES:
[ogname]
Blogs

PATHS:
[ogalias]
node/[ogid]/content/blogs

This works completely fine when the view returns a piece of content (see working-tokens.png)
But if the view has no results it does not replace the tokens and the breadcrumbs end up using the tokens in the paths and the titles (see not-working.png)

Am I missing something? This seems to be very strange behavior .

Cheers for any help you can provide,
Adam

CommentFileSizeAuthor
not-working.png17.85 KBacbramley
working-tokens.png22.34 KBacbramley
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley’s picture

Title: Tokens to not get replaced when view returns an empty set. » Tokens do not get replaced when view returns an empty set.
acbramley’s picture

I've tracked the problem down to the token replacement that happens around line 374 of custom_breadcrumbs.module. The problem lies in the fact that if the view returns no content then there are no nodes to get the og context from.

ptam’s picture

Please help me on this i have same issue for node view search.
Like this
Home » Collections » [field_site_id-title]

MGN’s picture

Category: bug » support

Yes. If there is no node object available, node-type tokens will fail. you can't replace the tokens without a node to reference. So I am not sure I see a way around this - the view needs to return a node. You could (potentially - I haven't tried this in a while) set the breadcrumb visibility to False (using php) if the view doesn't return a node. Then create another breadcrumb for the same view page that has some default breadcrumb that you would like to see when this happens.

brunorios1’s picture

subscribing

lamp5’s picture

Issue summary: View changes
Status: Active » Closed (outdated)