Closed (fixed)
Project:
Token
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2011 at 22:31 UTC
Updated:
28 Mar 2011 at 23:01 UTC
I tried to use the same *.tokens.inc I'm using in Google analytics in Piwik, but if configured I receive below notices:
Notice: Array to string conversion in token_replace() (line 95 of drupal7\includes\token.inc).
Notice: Array to string conversion in token_replace() (line 95 of drupal7\includes\token.inc).
Notice: Array to string conversion in token_replace() (line 95 of drupal7\includes\token.inc)
and the resulting code is wrong (_paq.push(['setCustomVariable', 1, "User roles", "Array"]);). Is it not possible to use the same token names in more than one module if they are really the same? Renaming the tokens to a unique name works, but than some users may use [current-user:role-names] from Google Analytics module in Piwik or vice versa. Dependencies may break than... so - why is it not possible to have two identically tokens names from different modules with the same data?
Comments
Comment #1
hass commentedMaybe more support question...
Comment #2
dave reidBecause module_invoke_all uses array_merge() which combines two array values that have the same keys into an array value.
See #1061714: Improve checking for token definition problems
Comment #3
hass commentedSo different modules should not define the same token placeholder?
Comment #4
gregglesCorrect.