There is a bug on line 113 of user_relationships_api/user_relationships_api.module:

elseif ($type = 'relationship') {
$tokens['user_relationships_api'] = array(
'requestee' => t('The user who approved the connnection request.'),
'relationship-name' => t('The relationship name (singular form)'),
);

Note how the elseif will always be true, as it is assigning the string 'relationship' rather than comparing to the variable. The '==' comparison operator should be used instead. The bug results in user_relationships tokens ALWAYS being returned, even if they have not been requested. This corrupts more sophisticated uses of the Token module.

I checked to see if the CVS repository had a fixed version in the dev branch, but the CVS browser didn't even have this file in the listing. Something's amiss with that, as well.

CommentFileSizeAuthor
#2 user_relationshipa_api_token_list.patch703 bytesjcmarco

Comments

ajayg’s picture

Status: Active » Needs review
jcmarco’s picture

StatusFileSize
new703 bytes

The patch for this typo

alex.k’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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