I get the following error when I enable Taxonomy Display:

Notice: Trying to get property of non-object in taxonomy_term_title() (line 1715 [...] public-html/modules/taxonomy/taxonomy.module)

This happens on the taxonomy term page and appears 3x each time it appears.

The error goes away when I disable Taxonomy Display.

This is a pretty vanilla site, new install, one taxonomy and one content type. Nothing special that I can tell at least. Let me know what additional info I can provide.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jay-dee-ess’s picture

Actually, looks like it may be a conflict with the Disable Term Node Listings, which I had enabled, but was not using. Disabled that and the error went away.

siefca’s picture

Same error here. I'm not using Disable Term Node Listings module, I just created taxonomy view based on built-in view and then removed it (wanted go back to built-in rendering). Then the error appeared.

siefca’s picture

Oh, that function gets some (term?) ID, not a term name, but asumes that it's a term object, that's why it happens.
The ID comes from some built-in or a view, that operates on ID-s instead of term objects. That's the problem. Let's see..

In my case the term ID is not just a term ID, it is a term ID from menu path that points to taxonomy term (my main menu links to terms from one of vocabularies).

The error comes from my patched version of menu_block_split module, which does menu item translation using Drupal's _menu_link_translate(). That function causes itle callbacks to be fired.

Some modules will affect Taxonomy Display in that way if they are using menu items translation and operate on (link to) taxonomy paths.
Taxonomy Display will then catch it with registered title callback hook.

I will add a patch that filters out such cases.

siefca’s picture

Status: Active » Needs review
FileSize
1.09 KB

Attaching a patch that adds some additional checks to see if we're getting real taxonomy term object.
It tries to obtain one if the given argument is numeric (assumed: term ID) or a string (assumed: term name).

sierratelecom’s picture

I applied this patch and it resolved the problem. Thanks

ron_s’s picture

Issue summary: View changes

I can confirm this patch fixes the error displayed after enabling the Disable Term Node Listings module. Thanks for posting it!