My apache server keep throwing this error message :

[Sun Nov 07 09:38:38 2010] [error] [client 127.0.0.1] PHP Notice: Undefined property: stdClass::$name in /home/mysite/public_html/sites/all/modules/rawlog/rawlog.module on line 176, referer: http://mysite/content/mynode

I can't say for sure but seems that this is due to anonymous user doesn't have user name.

I modified the code by adding :

// add this to line : 165
empty($log_entry['user']->name) ? $log_entry['user']->name = 'guest' : $log_entry['user']->name;

and the error went away.

Comments

vito_a’s picture

Assigned: Unassigned » vito_a
Status: Active » Needs review

Thank you. You should be using latest stable version 1.3. This is fixed at the 6.x-1.x-dev version already:

    '@name'          => isset($log_entry['user']->name) ? $log_entry['user']->name : 'anonymous',

However we may need to check it also for being empty. This will surely be in the 1.4 release.

Also can you tell us please if you prefer it to be 'anonymous' (like it is done in the core by default, as there is 'anonymous' users role) or you need it to be 'guest' for your site?

duckzland’s picture

Status: Needs review » Fixed

In my opinion, it is best to follow the core "anonymous" as maybe in the future if someone wants to develop the module further (eg. build a GUI report) they will surely follow the core behavior.

Will test the code once you release the 1.4 version.

Status: Fixed » Closed (fixed)

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