This error came up when visiting '/nodejs/stats'.
Notice: Undefined property: stdClass::$name in theme_nodejs_stats_page() (line 323 of /sites/all/modules/nodejs/nodejs.module
It is due to Anonymous users not having a name.

My 1st patch posted on D.O :)

CommentFileSizeAuthor
nodejs.module.patch515 byteslogii

Comments

afeijo’s picture

good job!

but actually, I don't think that Anonymous should have permission to see this page

logii’s picture

Thanks!

don't think the permissions matters.
The goal is to allow admins to see the number of anonymous users.

afeijo’s picture

Oops you're right, I confused it a bit :)

arithmetric’s picture

Status: Patch (to be ported) » Needs work

Hi logii,

Thanks for the patch. I have one suggestion: Since Drupal allows the "Anonymous" user's name to be changed on a site-by-site basis, I think your patch would be improved by using the site's setting for the user name. This string should also go through t() so it can be translated. So, you might consider something like:

$client->user->name = t(variable_get('anonymous', 'Anonymous'));
Anonymous’s picture

Status: Needs work » Fixed

thanks all, i've committed a modified version of this here:

http://drupalcode.org/project/nodejs.git/commit/5afb222

Status: Fixed » Closed (fixed)

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

  • Commit 5afb222 on 6.x-1.x, 7.x-1.x, drupalconlondon, auth-refactor, 8.x-1.x, 8.x-1.x-head by beejeebus:
    #1110972: fix username presentation, thanks logii and arithmetric