I have Realname working perfectly for all of my content nodes, but on pages generated by the Views module the author of the node still shows up using the drupal username instead of the realname.

I have seen this behavior in Realname 6.x-1.x-dev as well as the current stable version. I'm using Views 6.x-2.2.

You can see the issue on my test site at:

http://beta.njpinebarrens.com/articles/opinions

and it working perfectly for node content at:

http://beta.njpinebarrens.com

Thanks!

Comments

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new62.83 KB

I used "user: name" with the option to link to the user and you can see what happened in the attached snap shot.

ZippySLC’s picture

StatusFileSize
new110.55 KB

That's how I have mine configured as well.

nancydru’s picture

Do you have "Override username theme" enabled?

ZippySLC’s picture

StatusFileSize
new65.05 KB

Yes. Additionally I also disabled and re-enabled both modules, unchecked "override username theme", saved the config, and then rechecked it and resaved.

nancydru’s picture

I am using Views 6.x-2.2 and the most current RealName. As you see in my attached screen shot above, it is working on my system.

ZippySLC’s picture

Well, as you can see from my screenshots, it's not working for me.

I'm just going to have views display "Profile: Full Name" and not care about the link to the authors profile.

nancydru’s picture

Are you sure you're using the latest -dev code?

ZippySLC’s picture

I had tried both the -dev code and the stable code. Same experience with both.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Please open an issue against Views asking them to use theme('username',...). Then RealName will intercept it and show the Real Name.

ahaapaka’s picture

I just experienced the same problem with Views 6.x-2.3 and Realname 6.x-1.1.

However my problem suddenly disappeared... I had an existing view (created before installing the Realname module). When I updated several view settings and after saving them the problem disappeared. I'm very sorry but I don't remember all settings I changed, but I remember that I did rescan template files (Basic settings -> Theme: Information -> Rescan template files).

JamesAn’s picture

I can confirm ahaapaka's solution, using the same version modules: Views 6.x-2.3 and Realname 6.x-1.1

Just by pressing Rescan template files, the views picked up Realname instead of username.

For more information about that Views button, see #271019: "Rescan template files" button. The screenshot in that issue shows you where the button is located in the Views UI.

Can we consider this bug fixed?

nancydru’s picture

Status: Closed (won't fix) » Closed (fixed)
gausarts’s picture

Sorry to reopen, this is the closest issue I have.
I am pulling user picture and username, the views fine with the realname displayed as expected. Now when I created a custom views template, views-view-field--bla--picture.tpl. It works ok with imagecache, see http://drupal.org/node/362991. But the the hardest part is the attributes. Views seem to ignore theme_username, instead uses the login name when it comes to print its row. Any idea how to fix it? Thanks

roball’s picture

I don't understand why you need any functionality of the RealName module for views.

gausarts’s picture

I have a concern to hide login name from public, instead use realname for the entire public view. This in return makes realname acts as public or display name. Login name is for the user and site internal usage only. Hope that makes sense. What do you think?

gausarts’s picture

I can make it work with user_load, but with a single field, I doubt if this is the best way.

Here is the revised code from the above link:

$user;
$uid = arg(1);
$account = user_load(array('uid' =>$uid));
if(!empty($row->users_picture)) {
  //$profilename = check_plain($row->users_name);
  $profilename = theme('username', $account, array('plain' => TRUE)) ;
  $resized_pic = theme('imagecache','bigpic',$row->users_picture, $profilename, $profilename);
} else {
  //$profilename = check_plain($row->users_name);
  $profilename = theme('username', $account, array('plain' => TRUE)) ;
  $resized_pic = theme('imagecache','bigpic','/files/noavatar.png',$profilename, $profilename);
};

$user_link = 'user/' . $row->uid;

print l($resized_pic, $user_link, $options = array(html => TRUE));
?>

Any suggestion to make it work without user_load? Thanks.

nancydru’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

In Views, when you select "user: name" there is a check box to "Link this field to its user." If you select that, it should use theme_username.

roball’s picture

Title: Realname not working with views module » Working with Views module

gausarts, I am also using RealName to hide login names from the public and I have also set up a public user view (see https://www.iseki-food.net/drupal/board) that lists some users by their real name. I did not need any of RealName's functionality for this - that's why I am wondering why you do.

gausarts’s picture

Hi,

I did check the box, and as as I said it works fine when views displays it directly (out of the box) on the page, realname shows fine. But the problem comes when I need to give a certain different size and that's why I need to do some override from the default imagecache preset settings. I have to create a specific template for that particular need with particular override. And putting regular call to $row->users_name didn't reflect the realname, it falls back to login name.

There seems to be inconsistency when it comes to template override.

Hope I can make myself clear with that particular situation. Any hint? Thanks

nancydru’s picture

Have you opened an issue with Views? If so, please post the issue number here so we can track it.

I am not a Views expert by any stretch of the imagination. I have never attempted a template override.

dicreat’s picture

Version: 6.x-1.x-dev » 6.x-1.2

I have strange situation with Realname module and Views.
I'm using Views to listing recent comments on my site:

author (with link to user profile) -> title of comment (with link to comment)

If option "Override username theme" on Realname module configuration page are enable, then some authors in this listing don't have correct link to profile - only link to main page of site with title "View user's home page.". It's very strange, because on one page I see one author with correct link and with wrong link. If I turn off option "Override username theme", all links are correct.

nancydru’s picture

I think I need to double check that setting. I don't think "Override username theme" actually does much any more. There is another issue on where the username links to; that is probably the result of no longer doing user_load.

dicreat’s picture

I was enable "Overwrite user fields in view to show realnames" (this options was set successfully after applying patch from issue #462860: "Overwrite user fields in view" variable not setting in admin page) and I'm still have problem with Views type 'Comment': link to comment author's profile page was replacing with empty value. I thinks, it is because in Views I was enable option "Link this field to its user or an author's homepage" (works fine without Realname module) and Realname module in function realname_username at line 84 (realname_theme.inc) think, that $object->homepage is set and they try to replace comment author's profile link to comment author's website link.

I was change manually default value of 'homepage' to 'FALSE' in function realname_username at line 37 and its temporary solve my problem.

BettyJJ’s picture

I find that if in views, you check "Link this field to its user or an author's homepage", then it will display the realname. Otherwise it displays drupal username.
Is it possible to display realname without linking to its user homepage?

I have submitted a feature request to the Views module: http://drupal.org/node/591228

nancydru’s picture

I just applied #579040: Some bugfixes, which has some Views fixes. Please try the new -dev version when it rolls out later today.

brad.bulger’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
StatusFileSize
new379 bytes

i was seeing the same issue as @dicreat in #23 - the comment author name url was an empty string when they had no explicit homepage set.

i am fairly sure it's because isset("") tests as TRUE and views is giving you an empty string for the homepage value. i changed the test of the homepage to !empty() in realname_theme.inc and the author name links to the user's account page now.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed

Committed to 6.x-1.x-dev.

Status: Fixed » Closed (fixed)

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

mizerydearia’s picture

Status: Closed (fixed) » Needs review

Realname doesn't seem to work for views of type "Ubercart Orders" which is packaged with uc_views module specifically when adding a field for "User: Name"

I posted to this thread since it is related issue.

nancydru’s picture

Status: Needs review » Closed (fixed)

It is likely that it is not set up to use theme('username').

Please do not mark a "closed(fixed)" issue as needs review; open a new issue.