When regenerating content aliases I am now seeing the following warnings, one per alias.
warning: mb_strtolower() expects parameter 1 to be string, array given in /var/www/drupal/includes/unicode.inc on line 435.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | token_time.module.txt | 3.69 KB | skizzo |
Comments
Comment #1
dave reid1. Make sure you're using Token 6.x-1.15 or newer.
2. Double check your admin/reports/status page for a 'Duplicate token' warning. If you see one, please report it back here.
Comment #2
gregglesComment #3
skizzo commentedI am running 6.x-1.15 (2010-10-07). When I rebuild the node paths the PHP errors are logged in dblog (the aliases are correctly created). There is no mention of token in /admin/reports/status.
Comment #4
gregglesWhat other modules are you using that have token implementations?
Comment #5
skizzo commentedList of the currently available tokens on this site
CCK date
CCK file
CCK link
CCK node reference
CCK number
CCK text
Comment
Date
Domain
File
Flag
Flag-action
Global
Link
Node
Node reference
Number
String
Taxonomy
Text
User
User reference
Comment #6
skizzo commentedNot sure if following info is of any interest... anyway:
if I expand all available tokens, sort, count duplicates,
and list associated module, this is what I get
2 d (Date, Node)
2 date
2 day
2 dd
2 ddd
2 formatted (Number,Text)
2 link (User Reference, Node Reference)
2 m (Date, Node)
2 mm
2 mon
2 month
2 nid (Node Reference, Node)
2 path (Node Reference,User reference)
3 raw (Node, Number, Text)
3 title (Link, Node, Node Reference)
2 title-raw (Node Reference, Node)
2 uid (User, User Reference)
3 url (User Reference,Node Reference, Link)
2 view (Date,Link)
2 vocab (Node,Taxonomy)
2 vocab-raw
2 ww (Date,Node)
2 yy
2 yyyy
Comment #7
gregglesThey have to be duplicates at the same level.
You are likely going to need to do something like this:
in pathauto.inc change:
to be:
Then look in the watchdog for an array at a level where everything else is strings.
Comment #8
skizzo commentedAs I have no programming skills I can't really tell. What I get is the following debug record. Does that alone tell you something?
array ( 0 => '[domain-id]', 1 => '[domain-name]', 2 => '[domain-name-raw]', 3 => '[domain-url]', 4 => '[domain-url-raw]', 5 => '[domain-subdomain]', 6 => '[domain-subdomain-raw]', 7 => '[domain-default-id]', 8 => '[domain-default-name]', 9 => '[domain-default-name-raw]', 10 => '[domain-default-url]', 11 => '[domain-default-url-raw]', 12 => '[user-name]', 13 => '[user-id]', 14 => '[user-mail]', 15 => '[site-url]', 16 => '[site-name]', 17 => '[site-slogan]', 18 => '[site-mission]', 19 => '[site-mail]', 20 => '[site-date-yyyy]', 21 => '[site-date-yy]', 22 => '[site-date-month]', 23 => '[site-date-mon]', 24 => '[site-date-mm]', 25 => '[site-date-m]', 26 => '[site-date-ww]', 27 => '[site-date-day]', 28 => '[site-date-ddd]', 29 => '[site-date-dd]', 30 => '[site-date-d]', 31 => '[site-date-small]', 32 => '[site-date-raw]', 33 => '[site-date-since]', 34 => '[site-date-date]', 35 => '[site-date]', 36 => '[current-page-title]', 37 => '[current-page-path]', 38 => '[current-page-path-raw]', 39 => '[current-page-url]', 40 => '[current-page-number]', 41 => '[page-number]', 42 => '[save-lineage-termpath-raw]', 43 => '[save-lineage-termpath]', 44 => '[save-lineage-termpath:4]', 45 => '[save-lineage-termpath-raw:4]', 46 => '[save-lineage-termpath:5]', 47 => '[save-lineage-termpath-raw:5]', 48 => '[save-lineage-termpath:7]', 49 => '[save-lineage-termpath-raw:7]', 50 => '[save-lineage-termpath:79]', 51 => '[save-lineage-termpath-raw:79]', 52 => '[save-lineage-termpath:80]', 53 => '[save-lineage-termpath-raw:80]', 54 => '[save-lineage-termpath:86]', 55 => '[save-lineage-termpath-raw:86]', 56 => '[save-lineage-termpath:89]', 57 => '[save-lineage-termpath-raw:89]', 58 => '[save-lineage-termpath:94]', 59 => '[save-lineage-termpath-raw:94]', 60 => '[save-lineage-termpath:96]', 61 => '[save-lineage-termpath-raw:96]', 62 => '[save-lineage-termpath:97]', 63 => '[save-lineage-termpath-raw:97]', 64 => '[save-lineage-termpath:98]', 65 => '[save-lineage-termpath-raw:98]', 66 => '[save-lineage-termpath:100]', 67 => '[save-lineage-termpath-raw:100]', 68 => '[save-lineage-termpath:101]', 69 => '[save-lineage-termpath-raw:101]', 70 => '[save-lineage-termpath:103]', 71 => '[save-lineage-termpath-raw:103]', 72 => '[save-lineage-termpath:105]', 73 => '[save-lineage-termpath-raw:105]', 74 => '[save-lineage-termpath:106]', 75 => '[save-lineage-termpath-raw:106]', 76 => '[save-lineage-termpath:108]', 77 => '[save-lineage-termpath-raw:108]', 78 => '[save-lineage-termpath:109]', 79 => '[save-lineage-termpath-raw:109]', 80 => '[save-lineage-termpath:110]', 81 => '[save-lineage-termpath-raw:110]', 82 => '[save-lineage-termpath:113]', 83 => '[save-lineage-termpath-raw:113]', 84 => '[save-lineage-termpath:115]', 85 => '[save-lineage-termpath-raw:115]', 86 => '[nid]', 87 => '[type]', 88 => '[type-name]', 89 => '[language]', 90 => '[title]', 91 => '[title-raw]', 92 => '[node-path-raw]', 93 => '[node-path]', 94 => '[node-url]', 95 => '[author-uid]', 96 => '[author-name]', 97 => '[author-name-raw]', 98 => '[author-mail]', 99 => '[author-mail-raw]', 100 => '[log-raw]', 101 => '[log]', 102 => '[node_comment_count]', 103 => '[unread_comment_count]', 104 => '[yyyy]', 105 => '[yy]', 106 => '[month]', 107 => '[mon]', 108 => '[mm]', 109 => '[m]', 110 => '[ww]', 111 => '[day]', 112 => '[ddd]', 113 => '[dd]', 114 => '[d]', 115 => '[small]', 116 => '[raw]', 117 => '[since]', 118 => '[date]', 119 => '[mod-yyyy]', 120 => '[mod-yy]', 121 => '[mod-month]', 122 => '[mod-mon]', 123 => '[mod-mm]', 124 => '[mod-m]', 125 => '[mod-ww]', 126 => '[mod-day]', 127 => '[mod-ddd]', 128 => '[mod-dd]', 129 => '[mod-d]', 130 => '[mod-small]', 131 => '[mod-raw]', 132 => '[mod-since]', 133 => '[mod-date]', 134 => '[menu]', 135 => '[menu-raw]', 136 => '[menupath]', 137 => '[menupath-raw]', 138 => '[menu-link-title]', 139 => '[menu-link-title-raw]', 140 => '[menu-link-mlid]', 141 => '[menu-link-plid]', 142 => '[term]', 143 => '[term-raw]', 144 => '[term-id]', 145 => '[vocab]', 146 => '[vocab-raw]', 147 => '[vocab-id]', 148 => '[activity-node-link]', 149 => '[activity-node-creator-link]', 150 => '[flag-bookmarks-count]', 151 => '[flag-automoderazione-count]', 152 => '[medium]', 153 => '[large]', 154 => '[g]', 155 => '[G]', 156 => '[h]', 157 => '[H]', 158 => '[i]', 159 => '[s]', 160 => '[U]', 161 => '[mod-medium]', 162 => '[mod-large]', 163 => '[mod-g]', 164 => '[mod-G]', 165 => '[mod-h]', 166 => '[mod-H]', 167 => '[mod-i]', 168 => '[mod-s]', 169 => '[mod-U]', 170 => '[termpath]', 171 => '[termpath-raw]', 172 => '[termalias]', 173 => '[termalias-raw]', )
Comment #9
gregglesNothing in there looks like a problem to me. I'm stumped.
Comment #10
dave reidWe need to debug the token values, not the token names. Change the line from:
watchdog('debug', var_export($tokens, true));to
watchdog('debug', var_export($full->values, true));Comment #11
greggles(my bad)
Comment #12
skizzo commentedHere you go. I just replaced real FQDN and mail with fake data (mydomain.com being the "primary" Domain Access domain). Maybe the problem lies with dates (115 => and 130 =>) ???
array ( 0 => '0', 1 => 'mydomain', 2 => 'MYDOMAIN', 3 => 'mydomaincom', 4 => 'mydomain.com', 5
=> 'www', 6 => 'www', 7 => 0, 8 => 'mydomain', 9 => 'MYDOMAIN', 10 => 'mydomaincom', 11 =>
'mydomain.com', 12 => 'admin', 13 => '1', 14 => 'admin@mydomain.com', 15 =>
'http://mydomain.com/en', 16 => 'MYDOMAIN', 17 => 'site slogan...', 18 => 'site
mission...', 19 => 'noreply@mydomain.com', 20 => '2010', 21 => '10', 22 => 'October',
23 => 'Oct', 24 => '10', 25 => '10', 26 => '41', 27 => 'Thursday', 28 => 'Thu',
29 => '14', 30 => '14', 31 => '14 Oct 2010 - 22:58', 32 => 1287089887, 33 => '0
sec', 34 => '4', 35 => '14 Oct 2010 - 22:58', 36 => 'URL aliases', 37 =>
'admin/build/path/pathauto', 38 => 'admin/build/path/pathauto', 39 =>
'http://mydomain.com/en/admin/build/path/pathauto', 40 => 1, 41 => 1, 42 => false,
43 => false, 44 => '', 45 => '', 46 => '', 47 => '', 48 => '', 49 => '', 50 =>
'', 51 => '', 52 => '', 53 => '', 54 => '', 55 => '', 56 => '', 57 => '', 58 =>
'', 59 => '', 60 => '', 61 => '', 62 => '', 63 => '', 64 => '', 65 => '', 66 =>
'', 67 => '', 68 => '', 69 => '', 70 => '', 71 => '', 72 => '', 73 => '', 74 =>
'', 75 => '', 76 => '', 77 => '', 78 => '', 79 => '', 80 => '', 81 => '', 82 =>
'', 83 => '', 84 => '', 85 => '', 86 => '20821', 87 => 'topic', 88 => 'TOPIC',
89 => 'it', 90 => 'Placerat aliquet urna', 91 => 'Placerat aliquet urna', 92 =>
'node/20821', 93 => 'node/20821', 94 => 'http://mydomain.com/en/node/20821', 95 =>
'27', 96 => 'guestuser', 97 => 'guestuser', 98 => 'xxx@mydomain.com', 99 =>
'xxx@mydomain.com', 100 => '', 101 => '', 102 => '0', 103 => '0', 104 =>
'2010', 105 => '10', 106 => 'September', 107 => 'Sep', 108 => '09', 109 => '9',
110 => '38', 111 => 'Sunday', 112 => 'Sun', 113 => '26', 114 => '26', 115 =>
array ( 0 => '26 Sep 2010 - 17:38', 1 => '26 Sep 2010 - 17:38', ), 116 =>
'1285515521', 117 => '2 weeks 4 days', 118 => '7', 119 => '2010', 120 => '10',
121 => 'September', 122 => 'Sep', 123 => '09', 124 => '9', 125 => '38', 126 =>
'Sunday', 127 => 'Sun', 128 => '26', 129 => '26', 130 => array ( 0 => '26 Sep
2010 - 17:38', 1 => '26 Sep 2010 - 17:38', ), 131 => '1285515521', 132 => '2
weeks 4 days', 133 => '7', 134 => '', 135 => '', 136 => '', 137 => '', 138 =>
'', 139 => '', 140 => '', 141 => '', 142 => 'Section Two', 143 => 'Section Two',
144 => '18082', 145 => 'Section', 146 => 'Section', 147 => '86', 148 =>
'Placerat aliquet urna', 149 => 'guestuser', 150 => 0, 151 => 0, 152 => 'Sun,
26/09/2010 - 17:38', 153 => 'Sunday, 26 September, 2010 - 17:38', 154 => '5',
155 => '17', 156 => '05', 157 => '17', 158 => '38', 159 => '41', 160 =>
'1285515521', 161 => 'Sun, 26/09/2010 - 17:38', 162 => 'Sunday, 26 September,
2010 - 17:38', 163 => '5', 164 => '17', 165 => '05', 166 => '17', 167 => '38',
168 => '41', 169 => '1285515521', 170 => array ( 0 => 'Section Two', ), 171 =>
array ( 0 => 'Section Two', ), 172 => 'section/section-two', 173 =>
'section/section-two', )
Comment #13
dave reidSo it looks like the [small] token is getting defined twice. The [termpath] and [termpath-raw] tokens should be arrays by design and not actually be causing problems.
Comment #14
dave reidYou'll have to make sure you're using the latest Token module and then go to admin/reports/status to find out which modules are at fault for defining the [small] token more than once.
Comment #15
skizzo commentedNothing reported by /status, but going through all my modules I noticed the attached "token_time" : Add missing tokens for hours, minutes, seconds. You can disable this module once a new version of token is out. (but then you have to change all your tokens to the format supported in the new version of token!). A forgotten patch maybe... After removing it the annoying warning seems gone. Thank you.
Comment #16
heyyo commentedI get this error every time I edit page of a content type which uses taxonomy. No error is returned if I edit page which doesn't use taxonomy.
I modified the pathauto.inc to get the debug, but not sure waht to look for:
I'm using the patch for i18n by pokurek http://drupal.org/node/290421#comment-3763178
Comment #17
heyyo commentedComment #18
heyyo commentedNot sure if it's related but this error has appeared at the same time than this one, on Panels page only in translated language:
htmlspecialchars() expects parameter 1 to be string, array given dans /home/XXXX/sites/includes/bootstrap.inc à la ligne 857.Comment #19
dalad commentedsubscribing.
I've just updated to Token 6.x-1.15 and Pathauto 6.x-1.5 and I still see the error in the logs
Comment #20
gianfrasoft commentedI had the same problem and never found the token duplication.
I solved adding an hack code inside pathauto.inc file:
I simply transform the array in a string getting the first element inside of it.
I hope this may help anybody.
Bye!
Comment #21
dave reid@gianfrasoft: You are not using the latest Pathauto release that accounts for some path-style tokens returning a valid array.
Comment #22
gianfrasoft commented@Dave Reid - I'm using the latest: 6.x-1.5
Comment #23
dave reid@gianfrasoft: No you're not as that function as defined in 6.x-1.5 is:
which has additional code to handle an array if $options['pathauto'] is TRUE.
Comment #24
gianfrasoft commented@Dave Reid - You were right, thank you!
In my files there was a little chaos, version 1.5 of pathauto solved the problem. Bye.
Comment #25
gianfrasoft commentedThe problem occurred againd during a node_save API call, right using Pathauto ver. 6.x-1.5. It seems to be a curse.
I re-added the same code posted in my comment #20 and I solved again definitively.
Here is the code, again:
Comment #26
gregglesUnless it's a patch, the status should not be "needs review."
Since this fixes the symptom (noise in Pathauto) rather than the bug (buggy code in some other module) it won't be committed to Pathauto.
Please search for which module is causing the problem and file a bug with it.
Comment #27
dkane commentedI'm not sure if this provides any insight at all, but I was getting this same error (although the error was on line 441). I was also getting the following error along with it:
warning: mb_eregi_replace() expects parameter 3 to be string, array given in all/modules/pathauto/pathauto.inc on line 236. (as addressed in http://drupal.org/node/324404).
The node I was creating used the CCK field module "Phone Number" (http://drupal.org/project/cck_phone), and I found that when I disabled this module the errors went away. I'm not sure if this will shed any insight into the problem, but I figured I'd post my findings here anyway. I will also post this finding over on the "Phone Number" issues cue.
Comment #28
buda commentedI had the same problem with the Phone Number module (http://drupal.org/project/cck_phone). I tried the 6.x-1.x-dev version and the error messages had disappeared.
Comment #29
dave reid@buda: Good god, the phone module provides it's tokens under the names 'raw' and 'formatted' which likely would conflict if any other token modules defines those tokens either in a node or global context. Horrible, horrible token name choices...
Please file an issue in phone.module to get those tokens properly namespaced.