I am using Pathauto to create meaningful paths for my organic groups in the format of:
www.mysite.com/group/$GROUP_NAME$

I've installed OG User Roles and are using the Group Logo functionality included with it. I noticed that while it does wrap the image in an anchor tag that links back to the group home, it does so irrespective of any system aliases that have been set up.

So basically, the system is generating:
www.mysite.com/node/$NID$

when it should be generating:
www.mysite.com/group/$GROUP_NAME$

for the anchor tag's href.

I dug around in og_user_roles.module and found the following at line 3259:
$output = "<a href='" . base_path() . "node/" . $node->nid . "'>" . $imglink . "</a>";

I'm not 100% how the alias module works, but I figure it should hook into that instead of hardcoding node/$node->nid.

CommentFileSizeAuthor
#1 og_user_roles-300376-981069.patch669 bytesmolenick

Comments

molenick’s picture

Status: Active » Needs review
StatusFileSize
new669 bytes

Changing the aforementioned line to:

$output = "<a href='" . base_path() . drupal_get_path_alias("node/" . $node->nid) . "'>" . $imglink . "</a>";

Should do the trick. drupal_get_path_alias() will return the original path if no alias exists.

somebodysysop’s picture

Status: Needs review » Closed (duplicate)

When released, this should do the same thing: http://drupal.org/node/287571