Closed (fixed)
Project:
User Stats
Version:
6.x-1.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2009 at 06:31 UTC
Updated:
3 Jul 2010 at 22:19 UTC
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
Comments
Comment #1
ad6 commentedMe to. How can this be fixed?
Comment #2
liam mcdermott commentedWow, comment module passes a NULL value through to hook_comment() when the user is anonymous. Added a check to work around it.
Comment #3
liam mcdermott commentedI'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. :)
Comment #4
ad6 commentedI 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.
"
Comment #5
ad6 commentedI said that the error apears only in Recent log entries - PHP but it apears on the site to the visitor too.
Comment #6
liam mcdermott commentedComment #7
liam mcdermott commentedAnother 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. :)
Comment #9
c.breschkow commentedIf I take a look to my user profile I get following error messages:
* user warning: UID is not a number. in /home/www/doc/21643/xxx/www/sites/all/modules/user_stats/user_stats.module on line 88.
* user warning: UID is not a number. in /home/www/doc/21643/xxx/www/sites/all/modules/user_stats/user_stats.module on line 198.
* user warning: UID is not a number. in /home/www/doc/21643/xxx/www/sites/all/modules/user_stats/user_stats.module on line 239.
* user warning: UID is not a number. in /home/www/doc/21643/xxx/www/sites/all/modules/user_stats/user_stats.module on line 198.
The error message is also shown if I create a new user and log in.
Comment #10
liam mcdermott commentedThat's not the same problem as was described in the initial bug report. This is related to the error seen when an anonymous user posts a comment. :)
I'm working on fixing this right now, so hopefully you won't need to raise another bug report.
Comment #11
honus commentedI am receiving this same error when importing a wordpress file. It's probably the comments. I'd like to keep them, so I am wondering if there is a fix in the works.
Thanks.