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

ad6’s picture

Me to. How can this be fixed?

liam mcdermott’s picture

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.

liam mcdermott’s picture

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. :)

ad6’s picture

Priority: Normal » Critical
Status: Fixed » Closed (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.

"

ad6’s picture

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

liam mcdermott’s picture

Priority: Critical » Normal
Status: Closed (won't fix) » Active
liam mcdermott’s picture

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. :)

Status: Fixed » Closed (fixed)

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

c.breschkow’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc1
Status: Closed (fixed) » Active

If 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.

liam mcdermott’s picture

Status: Active » Closed (fixed)

That'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.

honus’s picture

I 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.