http://wo0.cn/rss.xml
Notice: Trying to get property of non-object 在 taxonomy_breadcrumb_node_view() (行 70 在 /home/huoxz/public_html/sites/all/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stkrzysiak’s picture

This appears to only happen to my nodes without any tags assigned, I am going to look into a patch.

stkrzysiak’s picture

Git patch attached, it just checks to see if an object was returned, and if not, it sets $breadcrumb to an empty array.

Refineo’s picture

I have the same issue here. This module should work also if some content types are not to be assigned taxonomy at all.

Notice: Trying to get property of non-object in taxonomy_breadcrumb_node_view() (line 70 of /***/sites/all/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.module). =>
... (Array, 10 elements)
Krumo version 0.2.1a | http://krumo.sourceforge.net Called from /***/sites/all/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.module, line 70  

Notice: Trying to get property of non-object in _taxonomy_breadcrumb_generate_breadcrumb() (line 117 of /***/sites/all/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc). =>
... (Array, 11 elements)
Krumo version 0.2.1a | http://krumo.sourceforge.net Called from /***/sites/all/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc, line 117  

I will try your patch now.

Environment

  • D7.8
  • taxonomy_breadcrumb 7.x-1.x-dev
Refineo’s picture

I applied the patch above and it works fine for me now. Thank you !

GANYANCI’s picture

Yes, it's worked.

mrsinguyen’s picture

Patch in comment #2 works well. Thank you!

kardave’s picture

Status: Active » Needs review

Patch in #2 worked for me too!

Olarin’s picture

Patch works for me as well. This issue also manifests on draft content when using Workbench; obviously the patch doesn't fix the fact that the breadcrumb doesn't appear in draft mode, but at least it suppresses the unhelpful errors.

Refineo’s picture

I confirm #8 that this patch doesn't fix that breadcrumbs don't appear in Workbench draft mode.

Barm23’s picture

patch code with home text

      if(is_object($term))
        $breadcrumb = _taxonomy_breadcrumb_generate_breadcrumb($term->tid);
      else {
        $home_text = variable_get('taxonomy_breadcrumb_home', t('Home'));
		if ($home_text != '') {
			$breadcrumb[] = l($home_text, NULL);
		}
      }
dgastudio’s picture

same problem, same solution

yuriy.babenko’s picture

Attaching alternate patch for the same issue.

Refineo’s picture

Patch in #12 works for me and suppresses the error messages.

jantoine’s picture

The Taxonomy Breadcrumb module should only take over breadcrumbs if a node is in fact associated with a taxonomy/term. Otherwise it should leave the system breadcrumbs alone. The attached patch fixes this.

@Barn23
The home page breadcrumb is already added to the breadcrumb in the _taxonomy_breadcrumb_generate_breadcrumb() function. I believe you are seeing a side effect of this bug where the module is setting a blank breadcrumb to nodes that are not associated with a taxonomy/term. In this case, the updated patch will leave breadcrumbs alone and use the system breadcrumb. If you changed the home page breadcrumb text, you can change the system home page breadcrumb text to match the Taxonomy Breadcrumb module by implementing the hook_menu_breadcrumb_alter() function in either your theme (preferable) or a custom module. Example code is below::

/**
 * Implements hook_menu_breadcrumb_alter().
 */
function mytheme_menu_breadcrumb_alter(&$active_trail, $item) {
  // Set the home breadcrumb title.
  $active_trail[0]['title'] = t('Home page breadcrumb text');
}
Refineo’s picture

Patch in #14 works for me as well and suppresses the error messages.

Drupal 7.12

drupix’s picture

Patch in #14 works for me as well.
Drupal 7.12

Anonymous’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

This works. Nice patches everyone!

Setting this to "major" as without this patch it will certainly mess up some, perhaps all, sites using this module.

Also setting this to RTBC since we have a few reviews and it correctly maintains the intended functionality without causing any other random breakage.

rwilson0429’s picture

Patch in #14 worked great. Thanks.

Anonymous’s picture

Hi there,

Works here, too. Please commit. It fills up logs quite severely. :)

jantoine’s picture

Status: Reviewed & tested by the community » Fixed

Patch in #14 has been committed.

Status: Fixed » Closed (fixed)

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

Screenack’s picture

I'm running the 7.x-1.x-dev, (datestamp = "1349226018") which I presume includes the above patch and I'm still seeing this very error dialog on /taxonomy/term/1

Notice: Trying to get property of non-object in _taxonomy_breadcrumb_generate_breadcrumb() (line 92 of /var/www/drupal/sites/all/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc).

Let me know if I should create a separate issue for this, if its not related to the original post.

jantoine’s picture

@screenack,

I am unable to reproduce this issue, so it looks like you are running into a new issue, perhaps based on your setup. Please open a new issue with detailed steps on how to reproduce the issue you are seeing.

Screenack’s picture

I was able to easily create my error on a clean-and-fresh install and only tb, so I created the ticket, thanks: http://drupal.org/node/1855286

xurizaemon’s picture

Version: 7.x-1.x-dev » 6.x-1.1
Status: Closed (fixed) » Needs review

Patch applies to 6.x-1.1 and is required there also.

gisle’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

The Drupal 6 version is no longer supported. Closing this as outdated. If you think this is still relevant for Drupal 7 or Drupal 9, please open a new issue.