When I tried to reload page as logged user it counts only one view how it supposed.

But when anonymous user reload pages it always add view.

Same problem on demonstration site: http://sandbox.davereid.net/

Comments

anantagati’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.22 KB
dave reid’s picture

Hmm...I can confirm the problem on the sandbox. I'll take a look on my local site to see if the dev version still has the same problem.

dave reid’s picture

I fixed the problem on the sandbox and the fix in the module should be out today. The actual change that fixes this is in statistics_advanced_boot():

-      $user_uid = db_result(db_query_range("SELECT uid FROM {accesslog} WHERE (path = '%s' OR uid > 0) AND sid = '%s'", array($_GET['q'], session_id()), 0, 1));
-      if ($user_uid === 0) {
+      $user_uid = db_result(db_query_range("SELECT uid FROM {accesslog} WHERE (path = '%s' OR uid > 0) AND sid = '%s' ORDER BY timestamp DESC", array($_GET['q'], session_id()), 0, 1));
+      if (is_numeric($user_uid) && $user_uid == 0) {
dave reid’s picture

Fixed in 6.x-1.x and I even wrote a unit test to make sure this doesn't revert. http://drupal.org/cvs?commit=159503

dave reid’s picture

Status: Needs review » Fixed

EDIT: Thanks Drupal.org, for showing an error and letting me double post.

Status: Fixed » Closed (fixed)

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