Depending on module weights, flag might actually run AFTER flag_friend therefore $account->content['flags'] might not be set.

Luckily there is hook_profile_alter

This patch moves the logic from hook_user('view') to hook_profile_alter().

CommentFileSizeAuthor
#3 flag_friend_721994-3.patch1.47 KBScott Reynolds

Comments

Scott Reynolds’s picture

Status: Needs review » Active

apparently i failed to attach a patch. I will see if i can find it again.

sirkitree’s picture

if you can find this again, i'll include it in the next rc

Scott Reynolds’s picture

Status: Active » Needs review
StatusFileSize
new1.47 KB

Thank you for bring this back up. Just had to git show this bad boy.

sirkitree’s picture

Status: Needs review » Fixed

committed.

Scott Reynolds’s picture

ahh instead of unsetting you should probably do

$account->content['flags'][$flag->name]['#access'] = FALSE;

just because its a good habit to be in.

sirkitree’s picture

thanks, committed that to -dev so it'll be in the next release

Status: Fixed » Closed (fixed)

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