Working with Views module

ZippySLC - December 27, 2008 - 21:58
Project:RealName
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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!

#1

NancyDru - December 30, 2008 - 23:58
Status:active» postponed (maintainer needs more info)

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

AttachmentSize
realname_views.jpg 62.83 KB

#2

ZippySLC - January 1, 2009 - 15:03

That's how I have mine configured as well.

AttachmentSize
views.png 110.55 KB

#3

NancyDru - January 1, 2009 - 18:36

Do you have "Override username theme" enabled?

#4

ZippySLC - January 1, 2009 - 21:36

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

AttachmentSize
realname-config-njpb.png 65.05 KB

#5

NancyDru - January 2, 2009 - 01:51

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.

#6

ZippySLC - January 2, 2009 - 14:01

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.

#7

NancyDru - January 2, 2009 - 21:23

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

#8

ZippySLC - January 10, 2009 - 14:53

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

#9

NancyDru - January 24, 2009 - 22:36
Status:postponed (maintainer needs more info)» 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.

#10

ahaapaka - February 15, 2009 - 10:18

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).

#11

JamesAn - March 10, 2009 - 03:57

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?

#12

NancyDru - March 10, 2009 - 05:18
Status:won't fix» closed

#13

gausarts - March 30, 2009 - 19:56

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

#14

roball - March 30, 2009 - 20:01

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

#15

gausarts - March 30, 2009 - 20:32

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?

#16

gausarts - March 30, 2009 - 21:08

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.

#17

NancyDru - March 30, 2009 - 23:26
Status:closed» 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.

#18

roball - March 30, 2009 - 23:44
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.

#19

gausarts - March 31, 2009 - 02:47

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

#20

NancyDru - March 31, 2009 - 04:56

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.

#21

dicreat - April 18, 2009 - 19:10
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.

#22

NancyDru - May 13, 2009 - 00:28

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.

#23

dicreat - May 24, 2009 - 10:57

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.

#24

BettyJJ - September 29, 2009 - 16:10

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

#25

NancyDru - October 1, 2009 - 15:33

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

#26

brad bulger - October 20, 2009 - 07:04
Version:6.x-1.2» 6.x-1.x-dev

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.

AttachmentSize
realname_theme.homepage.patch 379 bytes

#27

NancyDru - October 20, 2009 - 14:27
Status:postponed (maintainer needs more info)» fixed

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

#28

System Message - November 3, 2009 - 14:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.