Hi,

I've got token on my test site, and when I went to the devel tab on my page, I got the error:

Notice: Undefined variable: args in token_tokens() (line 681 of /srv/www/ozses.net/public_html/d7/sites/all/modules/token/token.tokens.inc).

Comments

davmorr’s picture

Title: All of a sudden I got this error. » Undefined variable: args in token_tokens() (line 681 of ... token/token.tokens.inc).

I changed the title to be a bit more indicative of the issue.

I also got this error on the node Devel tab -> Tokens sub-tab. I believe that this is being caused by a mistake in the the variable naming on line 681 of the token.tokens.inc file.

Currently, it reads:

$replacements[$original] = token_render_array(arg(NULL, $args), $options);

I believe that the $args variable should actually be $value, which is set on the previous line:

$replacements[$original] = token_render_array(arg(NULL, $value), $options);

The arg() drupal function expects a path string as it's optional second argument. The $value variable is set to a path string value on the previous line - 680:

$value = empty($url_options['alias']) ? drupal_get_path_alias($path, $language_code) : $path;

Changing this does fix the error, but a maintainer needs to confirm whether this assumption is correct or not.

dave reid’s picture

Status: Active » Fixed

This has already been fixed with 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

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