Download & Extend

After logging out the block doesn't know who I am.

Project:Known User Role
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:doublejosh
Status:active

Issue Summary

Displays the hello but no username...
Hello . Not you? Click here to login.

Comments

#1

Is there any way I could have set this up wrong?

The user has a username that's not blank or anything weird like that.

#2

Seems that the $known_user->name object value is blank in this theme_known_user_welcome() function.

I checked the cookie and the value is "4%7C", so I'm assuming that means "4|" encoded.

Looks like there is a hard coded line in the module the requires either documentation or an alternative...

<?php
setcookie
('known_user_role_details', $account->uid.'|'.$account->profile_first_name, time()+2592000, '/');
?>

The profile field profile_first_name is required for the block. Would be much more universal to use theme_username($user) there.
Then people can use the Real Name module to put a name in place of the username or they can do a username over right in the template.php

And, it appears something didn't make the jump to Drupal 6. In the known_user_role_load_user() function the user_load function doesn't use an array so the user never gets loaded to grab the name anyhow.

<?php
$known_user
= user_load(array('uid'=>explode('|',$_COOKIE['known_user_role_details'],1)));
?>

It also seems odd to store the name value in the cookie, only to look it up when making the block. Couldn't you just skip holding the name in the cookie or rely on that for the block? Though the later could be a problem after a username change perhaps.

#3

PS: I'm a GIT person myself, but would be interested in committing at least the second change. It's just a bug fix.
The first item I imagine is still up for discussion.

I haven't made a contrib commit before and this seems a good first step.

#4

Hi,

No one has touched this module for a looooong time, and it seems like there are bits of it made for the specific site it was originally concocted for! Do you have CVS access? If you want to tidy it up and you do, a co-maintainer would be great... =)

#5

Sure.

I thought I did, but I can't seem to login. I certainly am flying blind trying to login or what the procedure is for making updates to the module. Assume all commits are done to the dev version, then there is some kind of way to save off a dev version as a new module version.

I checked out the module anonymously and have made the changes above, minus the two questions I still have in the other thread.

Help or pointing as specific resources would be amazing. I've read the pages about cvs, but am unsure about getting changes live or if logging in is working.

#6

Assigned to:Anonymous» doublejosh

CVS is hell. Have you seen this? It's probably the most useful page:
http://drupal.org/handbook/cvs/quickstart

You can't commit any changes until I grant you access to this module, but I just did that, so you *should* be able to commit.

Please check-out the DRUPAL-6--1 branch, make your changes and commit back to the same place with a commit message in this format:
http://drupal.org/handbook/cvs/quickstart#commit

Then the packager (which runs every 12 hours) will automatically incorporate your work in to -dev and you can download it and make sure everything is ok. =)

#7

Thanks so much! I'll look through all this over the long weekend. Seems like a fun internet vacation to get started commit to Drupal... only took three years.