hi

i'm using v 6.x-1.2

in realname.module in the following function there is a leading forward slash before user, ie '/user/'

function realname_check_breadcrumbs($account) {
  $trail = array(l(t('Home'), ''));
  // If we are looking at someone other than the current user, fix the breadcrumb.
  if ($account->uid != $GLOBALS['user']->uid) {
    $trail[] = decode_entities(l($account->realname, '/user/'. $account->uid));
  }
  $trail = drupal_set_breadcrumb($trail);
}

shouldn't this slash be removed??

i'm getting weird breadcrumbs behavior for my user profiles

1. when logged in and viewing a user profile the breadcrumb looks like:
Home > Members > John Doe (where John Doe is not a link)

2. when not-logged in (viewing the site as anonymous) a user profile breadcrumb looks like this:
Home > John Doe (where John Doe is a link of form http://user/6

when i remove the leading slash the link is corrected (to the form of http://mydomain.com/members/john-doe) but the correct breadcrumb is still not injected (i want the breadcrumb to be like #1 above whether logged in or not)

thoughts?

CommentFileSizeAuthor
#4 realname-realname.module-556682.patch569 bytesdarktygur-1

Comments

jpshayes’s picture

I am also experiencing some issues with the link path in my breadcrumbs. On the user profile pages,
Lets say user 1's name is John. When viewing john's (user 1) profile, the breadcrumbs are Home >> John. But instead of John linking to

*http://example.com/user/1

it links to

*http://user/1

This happens whether you are logged-in or not
Its happening for all users not just #1

Any ideas?

villain666’s picture

please use this patch

i use this on several internal sites, all work fine with cleanurl and "dirty"-url 8-)

--- realname.module.orig        2009-12-02 05:03:30.000000000 +0500
+++ realname.module     2009-12-02 05:03:41.000000000 +0500
@@ -207,7 +207,7 @@
   $trail = array(l(t('Home'), ''));
   // If we are looking at someone other than the current user, fix the breadcrumb.
   if ($account->uid != $GLOBALS['user']->uid) {
-    $trail[] = decode_entities(l($account->realname, '/user/'. $account->uid));
+    $trail[] = decode_entities(l($account->realname, 'user/'. $account->uid));
   }
   $trail = drupal_set_breadcrumb($trail);
 }
Florent Jousseaume’s picture

Version: 6.x-1.2 » 6.x-1.3

Problem always present in 1.3 version.
Same problem, same patch :-)

darktygur-1’s picture

Status: Active » Needs review
StatusFileSize
new569 bytes

That slash at the beginning definitely does not belong. Attached is the patch I'm using. I made one extra change. The decode_entities call is kinda messy. I removed it and sent an 'html' option to Drupal's l() function so it doesn't encode the realname in the first place.

jpshayes’s picture

Patch in #4 working for me with realname 6.x-1.3 and drupal 6.16

leksat’s picture

sub

gapple’s picture

Status: Needs review » Reviewed & tested by the community

Simple patch looks good to me.

gapple’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

This issue was fixed in #994672: Wrong link in User Profile breadcrumbs and is available in the latest 6.x dev release.