I would like template_preprocess_username to return $variables['link_path'] and $variables['link_attributes'] if $variables['account'] is the current user, since a user always has access to his own profile regardless of the 'access user profiles' permission.

Suggesting to change line 2569 of theme.inc

if ($variables['uid'] && $variables['profile_access'])

to

if ($variables['uid'] && (($variables['uid']==$user->uid)||($variables['profile_access']))) {

and obviously adding $user as a global to the procedure.

Comments

jkr’s picture

Priority: Minor » Normal

For reference: #1138122: Profile link in logged-in block is dependant on 'access user profiles' permission. contains the result of this behaviour for the logintoboggan module.

Changed priority after reading the 'Priority levels of issues' in the issue manual. I guess I should have done that first, before filing an issue...

ann_meredith’s picture

subscribe

guillaumev’s picture

Status: Active » Needs review
StatusFileSize
new974 bytes

I agree with the issue and the solution provided.

I'm providing a patch based on jkr's comments to fix this...

drupalycious’s picture

dddave’s picture

Status: Needs review » Closed (won't fix)

This is an ancient feature request against Drupal 7. So this won't happen. Feature requests have to go against Drupal 8. Feel free to readjust this issue but make sure that with the new theme system this issue still holds relevancy.

jkr’s picture

What's the point of a new feature request for Drupal 8? It would stay there for a year and a half, and then be declared ancient and closed...

dddave’s picture

Perhaps if the feature request would have been against D8 in the first place this would have had been commited and backported. ;)
There are reasons why new features go against the release in development + there is hardly any chance to get a core commiter to check such a patch against D6 this late in the game anyway (if this patch would be deemed to be an exception). Sorry.

jkr’s picture

Against D8 would have been silly, since the problem is quite D7 specific. And as I recall, D8 wasn't open for feature requests at the time :)