Hello all,

I'm generally a user of drupal and don't get under the bonnet.
I'm using the colourise version 7 release.
I'm getting the following error message, and don't know where to start really.

Notice: Undefined property: stdClass::$name in comment_classes() (line 43 of /home/bevcarrc/public_html/sites/all/themes/colourise/template.php

Any assistance welcome.
As a user this looks like a bug, but it might well be something I have done.
Let me know if you would like any assistance in pin pointing the error.

http://www.bevcarr.co.uk/?q=node/61&page=2

The error message appears in the forum topic view.

Thanks in advance....

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rev314159’s picture

I had this problem but, it only showed up when there were anonymous comments while not logged in. It seems my issue stemmed from the $comment->name not having a value. Mine was a Drupal 6 site recently upgraded to Drupal 7, with this theme being upgraded as well. I still need to determine why $comment->name shows blank instead of my entry for the anonymous user. In the meantime, I added a check in line 43 to make sure the $comment->name is not blank:

if ($user->name == $comment->name) { 

to

if (($comment->name != '') && ($user->name == $comment->name)) { 

Don't forget to clear the cache after.

yashadev’s picture

Assigned: Unassigned » yashadev
Priority: Major » Normal
Status: Active » Needs review
FileSize
401 bytes

Here's a patch, please test it and let me know if it works :)

Rev314159’s picture

This worked for me.

yashadev’s picture

Status: Needs review » Fixed

Thank you, committed to 7.x-2.x.

Status: Fixed » Closed (fixed)

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

jestrado’s picture

jestrado’s picture

Hi...
It seems from all the comments that the patch attached here helped...
What do I have to do with the patch to make it work?

thanks in advance