I love the default replacement tokens that are available, like [log-date] or [account-url]. Is there any way for me to add more, like other user attributes? Ex: [account-my-attribute].

thanks

Comments

deciphered’s picture

Status: Active » Closed (fixed)

The reason I put Token support in in the first place was so you could access Profile fields, e.g., Have a profile field 'Real name' or 'First name' as the output.

Unfortunately I had made the assumption that Token would support the Profile module... I was wrong. There is, however, a patch for the Token module which I have tested, and with a minor fix (that I should have re-rolled a patch for), works perfectly to add Profile fields support with Mentions.

Checkout the issue here: #125640: Profile tokens

Closing this issue as there's nothing to be done on Mentions end.

Cheers,
Deciphered.

glen201’s picture

Category: feature » bug
Status: Closed (fixed) » Active

Please see http://drupal.org/node/125640#comment-2387042 on tokens -- I have some problems with the [token] appearing after the node is updated. I'm having to clear the drupal cache to make the field re-apply.

@Deciphered: You mentioned re-rolling a patch, #1 above. Is there a patch needed for mentions to work properly with the token profile patch?

Interestingly: I have the following defined in Mentions as the substitution: "[profile_fname] [profile_lname] @[user]" and the [user] field, which is not a profile token, is ALSO not rendered when the problem appears! Could this be an issue with Mentions itself?

Note also: when I change the input formats to include JUST a [user] field, the broken mention tokens work and show the username. However, as soon as I add a profile field, all the tokens start working again (for old nodes that didn't render) and exhibits the same problem for new edits, above (i.e. even [user] doesn't render and shows up as the token in [brackets]) .

THE FIX: add the 2 lines in the middle below in the _mentions_update function in mentions.module at the beginning

function _mentions_update($type, $mentions, $mid, $auid) {
  if(count($mentions)) //GMM: clear the input filter cache, we are saving a node with a mention
       cache_clear_all('*','cache_filter',TRUE);
  // Build array of old mentions.

Would the module maintainer consider adding this to the code?

-- glen

deciphered’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

There is no further Drupal 6 development planed for Mentions. Sorry this issue was never resolved.