When using the latest dev version of Token module, any use of the 'activity-profile-link' token leads to a fatal error: "Undefined index attributes_array in theme_activity_username() (line 768 of ...activity.module).

The reason as I understand it is that tokens now bypass the theme system, so nothing in template_process_activity_username() happens for tokens, and that is where that value is set up. So the theme_activity_username() function cannot make assumptions that they are available.

I'm not sure of the best fix for this, maybe just moving the processing from the preprocess into the theme function itself.

Comments

karens’s picture

Status: Active » Needs review

Hmm, actually it is simpler than that. The preprocess *is* running but $variables are not getting updated. The fix is to change:

function template_preprocess_activity_username($variables) {..

to

function template_preprocess_activity_username(&$variables) {..

I don't have a git checkout to make a patch right now, but that fixes the problem for me.

krisgraham’s picture

StatusFileSize
new405 bytes

Confirmed working for me. Patch attached.

Routh’s picture

I just want to say that the above patch worked out my issues with the Activity module and Drupal 7 as well. I was not able to regenerate messages when using the activity-profile_link_token and kept having it error out with an error 500 AJAX error. Applying the patch corrected this.

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

Good to go.

sirkitree’s picture

Status: Reviewed & tested by the community » Fixed

committed to 7.x-1.x branch

Status: Fixed » Closed (fixed)

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