Anonymous User Comment causes 'UID is not a number' errors

Kars-T - June 2, 2009 - 06:31
Project:User Stats
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

If an anonymous users posts a comment I get three errors like " UID is not a number. in /opt/drupal6-modules/user_stats/user_stats.module in Zeile 198."

If I look in line 198 it ofcourse misses the uid. If I look at your hook_comment implementation I see there ist no check if there really is a uid. Imho you should add a check if there really is one set so those messages won't appear.

Thanks!

Kars-T

#1

ad6 - June 16, 2009 - 18:03

Me to. How can this be fixed?

#2

Liam McDermott - June 26, 2009 - 07:15
Title:Anonymous User Comment» Anonymous User Comment causes 'UID is not a number' errors
Version:6.x-1.0-rc1» 6.x-1.x-dev

Wow, comment module passes a NULL value through to hook_comment() when the user is anonymous. Added a check to work around it.

#3

Liam McDermott - June 26, 2009 - 07:24
Status:active» fixed

I've committed a fix. In a few hours the -dev package on the project homepage will be updated. Download it, try it out and re-open this bug if it isn't fixed.

Thanks for the report. :)

#4

ad6 - July 4, 2009 - 15:09
Priority:normal» critical
Status:fixed» won't fix

I still get the error in Recent log entries - PHP. And the eror log caused by this module is HUGE. The error is not produced when a comment is posted, it is produced when navigating the site.
"

* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 239.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 239.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 239.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 635.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 239.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 239.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/xxx/public_html/sites/all/modules/user_stats/user_stats.module on line 635.

"

#5

ad6 - July 4, 2009 - 15:17

I said that the error apears only in Recent log entries - PHP but it apears on the site to the visitor too.

#6

Liam McDermott - July 4, 2009 - 16:59
Priority:critical» normal
Status:won't fix» active

#7

Liam McDermott - July 5, 2009 - 02:44
Status:active» fixed

Another attempt at fixing, comment.module was giving us a NULL value in a couple of other places. I've added checks to fix those specific conditions, but there may be more errors lurking that I haven't discovered yet.

Please set the status back to 'Active' if the problem persists (and provide some information on what circumstances are causing it). Thanks. :)

#8

System Message - July 19, 2009 - 02:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.