Since I've installed this module on a site I started having the warning on node pages that check_plain was getting an array instead of a string.
It seams that taxonomy_title_token_values function is missing a check.
In case the type is 'taxonomy' and the object param is null the i18strings function returns an array of translated taxonomies instead of nothing. I'm not sure this is intended by i18strings function but I added a check here to make sure it is called only when the object param has a value.
case 'taxonomy':
if (!empty($object)) {
Maybe I'm missing something else, but my tests show that everything is working fine.
Thanks
EDIT: the above code is not from the 6.x-1.5 version. We have modified the code a lot to include a case for 'node' but the check on the object param should be performed anyway.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | check_plain_called_with_array-1513930-3.patch | 730 bytes | miraclegr |
| #1 | taxonomy_title-node_tokens-1513930-2.patch | 4.58 KB | miraclegr |
Comments
Comment #1
miraclegr commentedHere is also a patch with all the changes to the module.
The reason for all these changes is to have the taxonomy title tokens available when displaying a node through the page title module.
Hope this is useful to someone.
Comment #2
jenlamptonThanks miraclegr,
Did you open a feature request for the taxonomy_title tokens to be available in the node scope? I think this patch belongs on that issue, not this one.
Would you please attach a patch here that addresses only this issue (and not the other one?) If so I'll be happy to review + commit.
Thanks for your help :)
Comment #3
miraclegr commentedYou're right.
Here's the patch for the check_plain issue for start.
Comment #4
jenlamptonI have committed this change to the 6.x branch. Thanks @miraclegr for the patch!
Comment #5.0
(not verified) commentedThe initial code snippet does not correspond to the version specified.