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.


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.

Members fund testing for the Drupal project. Drupal Association Learn more


miraclegr’s picture

Here 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.

jenlampton’s picture

Thanks 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 :)

miraclegr’s picture

You're right.

Here's the patch for the check_plain issue for start.

jenlampton’s picture

Version: 6.x-1.5 » 6.x-1.x-dev
Status: Active » Fixed

I have committed this change to the 6.x branch. Thanks @miraclegr for the patch!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

The initial code snippet does not correspond to the version specified.