Thanks for your work on this module. Exactly what I need....

Using the version from 2011-Dec-26, I get the following error when I try to use mypath/[term:name] as a path pattern for a vocabulary:

Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of /www/mysite/modules/taxonomy/taxonomy.tokens.inc)

I'm using Views 3 to generate a list of top-level taxonomy terms in a block. This error is returned for each term output by the view.

It does not generate an error if If I use mypath/[term:tid] instead.

(Running a dev version of Drupal 7.11 from 2011-Dec-30. Have not tried it on Drupal 7.10 or earlier)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

derhasi’s picture

Status: Active » Postponed (maintainer needs more info)

millionleaves, I checked the path on my test installation. There everything goes fine.

This must be an error on a module calling the entity_uri() function, e.g. if the module does not load the whole taxonomy term object. Maybe you could find out, what module produces this error by looking on what page this occurs, or looking at the modules you use.
If you have any more information, maybe I could help you. But with the information above this is clearly no entity path problem ;)

millionleaves’s picture

Thanks. I think the error is arising in the Taxonomy module. The reason I updated to a dev version of 7.11 is that it includes a fix for a Taxonomy issue I was having; I'll wait until 7.11 is released and see if this issue is still occurring.

ykyuen’s picture

Hi millionleaves,

i got exactly the same problem. i update the entity path of a taxonomy to service?field_service_tag_tid=[term:name]

it works for node view but not for taxonomy view.
Notice: Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of /var/www/d7/modules/taxonomy/taxonomy.tokens.inc).

is this fixed in 7.11-dev?

Julesmarie’s picture

I'm also getting this error when trying to use path/[term:name]. I'm using Drupal 7.11 and and Entity Path 7.x-1.x-dev

derhasi’s picture

ykyuen and Julesmarie, could you list the modules you have activated? Or best, try if the error goes away if ou deactivate other modules.

ykyuen’s picture

Sorry for the late reply. I try to repeat the problem in a fresh new installed drupal. here is the configuration detail.

Drupal 7.12

Enabled modules

  • Administration menu 7.x-3.0-rc1
  • Administration views 7.x-3.0-rc1
  • Chaos tools 7.x-1.0-rc1
  • Entity Path 7.x-1.x-dev
  • Module filter 7.x-1.6
  • Token 7.x-1.0-rc1
  • Views 7.x-3.1
  • Views Bulk Operations 7.x-3.0-rc1
  • Views UI 7.x-3.1

Disabled module

  • Toolbar 7.12

View setting

I create some terms in the default tags and add the following view which accept the term name as input parameter.

$view = new view;
$view->name = 'tags';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'tags';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Tags';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim'] = 0;
$handler->display->display_options['fields']['name']['alter']['html'] = 0;
$handler->display->display_options['fields']['name']['hide_empty'] = 0;
$handler->display->display_options['fields']['name']['empty_zero'] = 0;
$handler->display->display_options['fields']['name']['link_to_taxonomy'] = 1;
/* Contextual filter: Taxonomy term: Name */
$handler->display->display_options['arguments']['name']['id'] = 'name';
$handler->display->display_options['arguments']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['arguments']['name']['field'] = 'name';
$handler->display->display_options['arguments']['name']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['name']['default_argument_skip_url'] = 0;
$handler->display->display_options['arguments']['name']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['name']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['name']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['name']['glossary'] = 0;
$handler->display->display_options['arguments']['name']['limit'] = '0';
$handler->display->display_options['arguments']['name']['transform_dash'] = 0;
$handler->display->display_options['arguments']['name']['break_phrase'] = 0;
$handler->display->display_options['arguments']['name']['add_table'] = 0;
$handler->display->display_options['arguments']['name']['require_value'] = 0;
/* Filter criterion: Taxonomy vocabulary: Machine name */
$handler->display->display_options['filters']['machine_name']['id'] = 'machine_name';
$handler->display->display_options['filters']['machine_name']['table'] = 'taxonomy_vocabulary';
$handler->display->display_options['filters']['machine_name']['field'] = 'machine_name';
$handler->display->display_options['filters']['machine_name']['value'] = array(
  'tags' => 'tags',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'tags';

Entity path setting

  • Instance = Tags(tags)
  • Path pattern = tags/[term:name]
  • Path case = lowercase

Error

When i access the view with term name input say tags/apple, the following error is shown

Notice: Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of /var/www/drupal/modules/taxonomy/taxonomy.tokens.inc).

I try disabled the modules Administration menu and Administration views but still get the same error.

Hope the above information is useful for you. =)

iajay’s picture

subscribe

derhasi’s picture

@ykyuen, sorry for the late response. Is the "name" token listed in the replacement patterns?
If not - I guess- you must enable the EntityAPI.

@iajay, it was great you could provide some additional information instead of just "subscribe".

iajay’s picture

I have opened another issue because I thought my problem was little different
http://drupal.org/node/1498560

ykyuen’s picture

@derhasi

i could find the [term:name] in the replacement patterns and i did have the entity api module enabled. the version is 7.x-1.0-rc1. sorry that i missed this information in the previous comments.

Kit

ascii122’s picture

I had the same problem with term:name
Notice: Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of /site/modules/taxonomy/taxonomy.tokens.inc).

Since my view destination was using term name as a context I had wanted to pass the name (helps with readability). I switched the view to use tid and so it's functional now but it'd be sweet to be able to use the name so to make the urls readable

like
http://www.wildriverswool.com/showproduct/13

isn't as nice as

http://www.wildriverswool.com/showproduct/pets

thanks to anyone who can figure this out

-z

vood002’s picture

Subscribing, this module seems to be working fine but it is throwing PHP notices on unexpected pages

<?php
Notice: Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of /var/www/drupal7/modules/taxonomy/taxonomy.tokens.inc).
?>
alx22’s picture

Title: Can't use [term:name] for a term path replacement » Same issue

Subscribing.

I also have the problem when trying to use the token

[term:name] in a taxonomy to view redirect

same error message as above.

Notice: Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of .... modules/taxonomy/taxonomy.tokens.inc).

Works nicely with [term:tid]

LOVE THIS MODULE!! Awesome!!

derhasi’s picture

Title: Same issue » Can't use [term:name] for a term path replacement
derhasi’s picture

Status: Postponed (maintainer needs more info) » Postponed

I finally had time to have a look on that issue. I recognized that this is an issue for views itself, as that does only provide pseudo-objects to work with entity_uri(). In the case of taxonomy terms that is located in views_handler_field_taxonomy:render_link().

Attached there is a patch for the views module to temporarily fix that issue. I'd open a separate issue in the views issue queue later.

Postponed as long as the (missing) views issue is not fixed.

derhasi’s picture

Arg, and there is the temp patch ... sorry.

derhasi’s picture

droog’s picture

This patch did not fix the issue I am having - which is exactly what was reported originally:

"Notice: Undefined property: stdClass::$name in taxonomy_tokens() (line 105 of /modules/taxonomy/taxonomy.tokens.inc)."

Is any other info going to help? I used Drush to update all my models & core prior to patching.

Update:

1. drupal.org ate my less than and greater than characters that I wrapped around my Drupal root in the above error. I suspect that's not a good thing and may even be exploitable.

2. Turns out that "name" is not what I wanted to be using anyway. I've chosen another field from the taxonomy to use instead and the error's gone.

Testing: Tested the tags thing - drupal.org is at least stripping them entirely. Better than I had initially thought :)

jordan8037310’s picture

I can report that the patch helped with my implementation as well.

Sakhmed’s picture

Issue summary: View changes

Patch #16 solved my problem

asghaier’s picture

Patch #16 solved my problem

oriol_e9g’s picture

Status: Postponed » Reviewed & tested by the community

Patch in #16 adds [term:name] token and works.