I've installed this module and I get the message that it was installed successfully.

Then I go to Home > Administration > Configuration
I click on "Tokenize Drupal Variables" and just get an error message:

Notice: Array to string conversion in drupal_attributes() (line 2368 of C:\....................\includes\common.inc).

Recoverable fatal error: Object of class stdClass could not be converted to string in _theme_table_cell() (line 2297 of C:\..............\includes\theme.inc).

Any ideas?

Comments

piyuesh23’s picture

Hi matsbla,

Can you try the deve version of the module and see if this problem is reproducible. I am unable to reproduce this.

lucaslm’s picture

Hi, I'm new to drupal community, although i've known drupal for a while.

Anyway, After debugging it a while I think I know the problem. This page you are acessing lists the variables availables, and for that a function named "_token_var_get_variables", in the file "_token_var_get_variables.inc" is called. this function builds an array named $options, which contains every variable's value shown as strings indexed by the variable's name. When a variable is an array, the function iterates through it for each array position, and creates another entry in $options with it's value. This message is due to the fact than some variables are either arrays within arrays, or objects, so the value (which should be an string) is set as an array or object.
What I did to solve it was changing the condition in line 49 to (!is_array($value) && !is_object($value)) and wrapping lines 57 to 60 with the condition (!is_array($var_value)) and the errors dissapeared.

karenann’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB

I had to manually apply the edits to 7.x-1.1 release. Here's a patch file for testing. Second patch, hope I got this right. See also, http://drupal.org/node/1879804#comment-7316380

phayes’s picture

Status: Needs review » Fixed

Thanks! committed!

Status: Fixed » Closed (fixed)

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

matejmericnjak’s picture

Issue summary: View changes

the issue is active again in 7.x-1.1 - https://www.drupal.org/node/1570592