[support] statistics not working on some node types

Jeremy Andrews lists at kerneltrap.org
Thu Oct 18 12:22:47 UTC 2007


Hello Pierre-Yves,

On Thu, 18 Oct 2007 10:51:14 +0200
pyg <pyg at framasoft.net> wrote:

What version of Drupal are you using?  I'm going to assume
5.x.

> Do you know if the core statistics module allow some node
> content types to be excluded from being logged ?

No, it does not.  It uses the following logic to determine if
a given page view is a node view:

if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '')

So long as your node is viewed the standard Drupal way via
"node/#" this should work fine.  (URL aliasing doesn't
matter, as arg(0) and arg(1) will still be set correctly to
"node" and "#".)

> Since a few days, one of my CCK node type doesn't seem to
> execute statistics_exit() anymore, and I just can't figure
> out why !

So it used to work, then it stopped?

What did you change around the time it stopped working?

Typically I've only seen calls to statistics_exit() stop
working when there was a bug in your code somewhere causing a
PHP error before _exit() can be called.  Check your Watchdog
log as well as your Apache error_log (or the equivalent).

> I use a custom theme using a node-mycck_theme_name.tpl.php
> file, and everything works fine except that stats are not
> recorded anymore.

If you recently changed your template, it's possible you've
introduced an error there...

Cheers,
 -Jeremy

-- 
http://kerneltrap.org/
Jeremy Andrews - Owner


More information about the support mailing list