The node counters are decremented when editing a node. I have compared the conditions behind the ones the statistics module increments the node counters and the way it is done by this module. There's a slight difference.

It is just a one liner and there's a patch pending here (a request though) that affects this module, so I do not post a patch.

The fix is, in the file statistics_filter.module, find this line:

      if ((arg(0) == 'node') && arg(1)) {

and replace with this one:

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

For reference, this is how the statistics module looks:

  if (variable_get('statistics_count_content_views', 0)) {
    // We are counting content views.
    if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '') {
      // A node has been viewed, so update the node's counters.
      db_query('UPDATE {node_counter} SET .....

Comments

mikeryan’s picture

Priority: Critical » Normal

I'm not updating this module for 4.7, but if someone else cares to do it this patch does make sense.

markus_petrux’s picture

Without this fix the node counter may end up into huge integer. Note that totalcount is defined as bigint(20) unsigned.

dan_aka_jack’s picture

I agree this patch is an important one.

The patch fixes this problem:

Insane number of page reads after a forum node is moved

mgifford’s picture

Worked for me..

So is someone going to commit the patch for 4.7?

Not sure, but it looked like the maintainer said he's not maintaining this module for 4.7..

Mike

t3rmin’s picture

Works for me, too. Thanks.

deekayen’s picture

Status: Reviewed & tested by the community » Fixed

Applied to HEAD and DRUPAL-4-7.

Anonymous’s picture

Status: Fixed » Closed (fixed)