Topic on Extension talk:HitCounters

Hit Count reported in Popular Pages is incorrect

8
PaulTimperley (talkcontribs)

This MediaWiki-based wiki has been running for some years without issues. I added the HitCounters extension when that was removed from the main software install; again, no issues until recently.

A few days ago I updated the site to version 1.38.1. HitCounters extension is 0.3.4.

in Special Pages -> Popular Pages, all pages show the same (large) hit count as the site's Main Page.

The hit count at the bottom of each page is still correct, and increments when the page is refreshed.

I assume the bug was not there with the previous MediaWiki version 1.37.1, I think I would have noticed.

103.140.78.202 (talkcontribs)

I suspect this has someting to do with the join_conds on getQueryInfo

Saucy (talkcontribs)

I have the same issue. Anyone know of a way to fix this?

Mochome (talkcontribs)

I have the same issue (mw1.38.1), so I looked at the log file and found the following output:

SELECT p.page_namespace AS `namespace`,p.page_title AS `title`,h.page_counter AS `value`,p.page_len AS `length`  FROM `page` `p`,`hit_counter` `h`    WHERE p.page_is_redirect = 0 AND p.page_namespace IN (0,12,4,3000)   ORDER BY value DESC LIMIT 51

I don't see a JOIN clause for hit_counter and page, is this the expected behavior?

217.71.1.56 (talkcontribs)

I have the same issue for 1.38

Mochome (talkcontribs)

I tried changing includes/HitCounters.body.php line 133 (public static function getQueryInfo) 'page' to 'p' then it seems to work.

132                         'join_conds' => [
133 #                               'page' => [
133                                 'p' => [
134                                         'INNER JOIN',
135                                         'p.page_id = h.page_id'
136                                 ]
137                         ]
212.84.154.148 (talkcontribs)

Thanks Mochome, this was also the fix for me!

Reply to "Hit Count reported in Popular Pages is incorrect"